<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hades.mech.northwestern.edu//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ErikChubb</id>
	<title>Mech - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://hades.mech.northwestern.edu//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ErikChubb"/>
	<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php/Special:Contributions/ErikChubb"/>
	<updated>2026-04-22T03:05:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=14549</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=14549"/>
		<updated>2009-11-03T20:35:26Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a circuit configuration commonly used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current digital signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V, but requires the assembly of a PCB.&lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which should not require the addition of copper wire and has been corrected and improved in other ways, but has &amp;#039;&amp;#039;not&amp;#039;&amp;#039; been tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=14548</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=14548"/>
		<updated>2009-11-03T20:34:56Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a circuit commonly used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current digital signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V, but requires the assembly of a PCB.&lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which should not require the addition of copper wire and has been corrected and improved in other ways, but has &amp;#039;&amp;#039;not&amp;#039;&amp;#039; been tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13440</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13440"/>
		<updated>2009-06-11T02:35:34Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit:&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here:[http://peshkin.mech.northwestern.edu/pic/code/FingerPositionSensor/Finger_positioning.c Finger_position.c]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13439</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13439"/>
		<updated>2009-06-11T02:34:58Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit:&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code/FingerPositionSensor/Finger_positioning.c Link code.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13436</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13436"/>
		<updated>2009-06-11T02:15:59Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit:&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13435</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13435"/>
		<updated>2009-06-11T02:15:43Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit:&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13432</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13432"/>
		<updated>2009-06-11T02:13:53Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit:&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13431</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13431"/>
		<updated>2009-06-11T02:12:29Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|&amp;quot;Finger Position PCB file&amp;quot;]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13430</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13430"/>
		<updated>2009-06-11T02:12:12Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optics&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Circuit and Code&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|&amp;quot;Finger Position PCB file&amp;quot;]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13429</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13429"/>
		<updated>2009-06-11T02:07:56Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) within a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|&amp;quot;Finger Position PCB file&amp;quot;]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13428</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13428"/>
		<updated>2009-06-11T02:07:00Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|&amp;quot;Finger Position PCB file&amp;quot;]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13427</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13427"/>
		<updated>2009-06-11T02:06:08Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array|interfacing]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13426</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13426"/>
		<updated>2009-06-11T02:04:03Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[Image:FingerPosition v05.pcb|Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13425</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13425"/>
		<updated>2009-06-11T02:02:25Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[http://hades.mech.northwestern.edu/wiki/index.php/Image:FingerPosition_v05.pcb| Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13424</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13424"/>
		<updated>2009-06-11T02:01:23Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[http://hades.mech.northwestern.edu/wiki/index.php/Image:FingerPosition v05.pcb| Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13423</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13423"/>
		<updated>2009-06-11T02:00:44Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The [[http://hades.mech.northwestern.edu/wiki/index.php/Image:FingerPosition_v05.pcb| Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13422</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13422"/>
		<updated>2009-06-11T01:59:08Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The PCB [[http://hades.mech.northwestern.edu/wiki/index.php/Image:FingerPosition_v05.pcb|Finger Position PCB file]] for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=File:FingerPosition_v05.pcb&amp;diff=13421</id>
		<title>File:FingerPosition v05.pcb</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=File:FingerPosition_v05.pcb&amp;diff=13421"/>
		<updated>2009-06-11T01:57:37Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13420</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13420"/>
		<updated>2009-06-11T01:52:25Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The PCB file for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here: &amp;lt;b&amp;gt;Finger_position.c&amp;lt;/b&amp;gt; [http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13419</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13419"/>
		<updated>2009-06-11T01:47:36Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The PCB file for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The PIC code to run this PCB is here.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13418</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13418"/>
		<updated>2009-06-11T01:46:43Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The PCB file for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The code to run this here.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13417</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13417"/>
		<updated>2009-06-11T01:45:46Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
The PCB file for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The code to run this here.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13416</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13416"/>
		<updated>2009-06-11T01:45:14Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger (or other object) in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is simply a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The analog data is clocked out of the TSL1406R using the PICs PWM signal and read into the PIC using the PIC&amp;#039;s on-board A2D.  The process is described in more detail on the wiki page, [[Interfacing with a Photodiode Array]], and in the data sheet for the TSL1406R.&lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is communicated via I2C to two MAX517 D2A chips, which output analog values for X and Y position.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;br /&gt;
&lt;br /&gt;
The PCB file for this device can viewed using PCBartist.  Before populating it with electronic components, be sure to mill out the 2&amp;quot;x2&amp;quot; square.  Clamping the PCB to a piece of plywood and using an 1/8&amp;quot; end mill was easy, and accurate.&lt;br /&gt;
&lt;br /&gt;
The code to run this here.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13415</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13415"/>
		<updated>2009-06-11T01:33:37Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  &lt;br /&gt;
&lt;br /&gt;
During the &amp;quot;integration time&amp;quot;, a capacitor accompanying each of the photodiodes is charged by its corresponding photodiode.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to a dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
Each TSL1406R has two 384-pixel arrays which can be interfaced in serial or in parallel.  This code interfaces with a single 384-pixel array.&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;br /&gt;
&lt;br /&gt;
For code that interfaces both 384-pixel arrays, and determines a finger&amp;#039;s position, see [[Finger Position Sensing with a Photodiode Array]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13414</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13414"/>
		<updated>2009-06-11T01:26:14Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  &lt;br /&gt;
&lt;br /&gt;
This duration that the photodiode is allowed to create charge is called the &amp;quot;integration time&amp;quot;.  During the integration time, an dedicated capacitor (included in the TSL1406R) is charged by each of the photodiodes.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to its dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
Each TSL1406R has two 384-pixel arrays which can be interfaced in serial or in parallel.  This code interfaces with a single 384-pixel array.&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;br /&gt;
&lt;br /&gt;
For code that interfaces both 384-pixel arrays, and determines a finger&amp;#039;s position, see [[Finger Position Sensing with a Photodiode Array]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13395</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13395"/>
		<updated>2009-06-10T23:33:38Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is nothing more than a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is output by the PIC over I2C to two MAX517 D2A chips, which output the X and Y analog values.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|700px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13394</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13394"/>
		<updated>2009-06-10T23:33:18Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is nothing more than a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is output by the PIC over I2C to two MAX517 D2A chips, which output the X and Y analog values.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|600px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=File:Finger_postition_board.JPG&amp;diff=13393</id>
		<title>File:Finger postition board.JPG</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=File:Finger_postition_board.JPG&amp;diff=13393"/>
		<updated>2009-06-10T23:32:47Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13392</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13392"/>
		<updated>2009-06-10T23:32:23Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is nothing more than a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is output by the PIC over I2C to two MAX517 D2A chips, which output the X and Y analog values.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;br /&gt;
&lt;br /&gt;
[[Image:finger_postition_board.JPG|right|400px|A single PCB is used to make the electrical connections and provide the mechanical support to the lasers, lenses, and photodiode]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13390</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13390"/>
		<updated>2009-06-10T21:24:23Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is nothing more than a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found by doing a &amp;quot;center of mass&amp;quot; calculation on the shadow&amp;#039;s profile.  The resultant X and Y position is output by the PIC over I2C to two MAX517 D2A chips, which output the X and Y analog values.&lt;br /&gt;
&lt;br /&gt;
There are only two tricky parts to the design of the code and circuit,&lt;br /&gt;
1) Interfacing with the TSL1406R requires precise timing.  The &amp;quot;start integration&amp;quot; (SI) pulse and the clock signal (being generated by the PIC&amp;#039;s PWM feature must be accurately phased.&lt;br /&gt;
2) To achieve 2ms loop times on the 18F4520 PIC, minimalistic integer code is required.  To improve looptime further, the PIC is running on a 40MHz clock.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13389</id>
		<title>Finger Position Sensing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Finger_Position_Sensing_with_a_Photodiode_Array&amp;diff=13389"/>
		<updated>2009-06-10T21:12:59Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This device finds the X and Y position of a finger in a 2&amp;quot;x2&amp;quot; square area.  The resolution is about 256 counts per axis and the update rate is 2ms.  The board output is a 0-5V analog signal for each X and Y position.&lt;br /&gt;
&lt;br /&gt;
For each axis, there is a 768-pixel photodiode array (TSL1406R) illuminated by laser light.  The laser light is produced by a &amp;quot;line generator&amp;quot; laser, which is nothing more than a laser pointer capped with a cylindrical lens.  The cylindrical lens creates a triangular area (not a cone) of divergent light.  To redirect the divergent light into parallel light in the sensing area, a 2&amp;quot; cylindrical Fresnel lens is placed between the laser and the photodiode array.  This parallel light creates a distinct shadow on the photodiode array and allows for a a full 2&amp;quot;x2&amp;quot; working area. &lt;br /&gt;
&lt;br /&gt;
The center of the shadow that the finger casts on the photodiode array is found and output over I2C to MAX517 D2A chips, which output the X and Y analog values.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13387</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13387"/>
		<updated>2009-06-10T20:51:20Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  This duration is called the &amp;quot;integration time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During the integration time, an dedicated capacitor (included in the TSL1406R) is charged by each of the photodiodes.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to its dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
Each TSL1406R has two 384-pixel arrays which can be interfaced in serial or in parallel.  This code interfaces with a single 384-pixel array.&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;br /&gt;
&lt;br /&gt;
For code that interfaces both 384-pixel arrays, and determines a finger&amp;#039;s position, see [[Finger Position Sensing with a Photodiode Array]]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13386</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13386"/>
		<updated>2009-06-10T20:44:05Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  This duration is called the &amp;quot;integration time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During the integration time, an dedicated capacitor (included in the TSL1406R) is charged by each of the photodiodes.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to its dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
Each TSL1406R has two 384 photodiode arrays which can be interfaced in serial or in parallel.  This code interfaces with a single 384 pixel array.&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13385</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13385"/>
		<updated>2009-06-10T20:40:48Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  This duration is called the &amp;quot;integration time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During the integration time, an dedicated capacitor (included in the TSL1406R) is charged by each of the photodiodes.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to its dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13384</id>
		<title>Interfacing with a Photodiode Array</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Interfacing_with_a_Photodiode_Array&amp;diff=13384"/>
		<updated>2009-06-10T20:37:35Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Wiring Diagram.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
[[Image:Expected Output.png|thumb|right|300px|Wiring Diagram]]&lt;br /&gt;
&lt;br /&gt;
The TAOS Photodiode Linear Sensor Array (TSL1406R) is an array of 768 photodiodes spread over the length of about 2 inches.  Each of the individual photodiodes outputs an analog voltage which is proportional the intensity and duration of incident light.  This duration is called the &amp;quot;integration time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During the integration time, a separate dedicated capacitor is charged by each of the photodiodes.  When the HOLD signal goes high, each of the charges accumulated during the integration time is simultaneously passed to its dedicated holding capacitor.  The analog voltages on each holding capacitor can then be read one-by-one at the clock speed.  Here I use the PWM function of the PIC to act as the CLK signal.&lt;br /&gt;
&lt;br /&gt;
In this particular code, the data is clocked out so quickly that it is impossible to read every analog level (since the PIC is only capable of an analog read every ~5us).  To remedy this, we low pass filter the analog output and read in analog data as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Sample code: Photodiode_array.c&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://peshkin.mech.northwestern.edu/pic/code Link to all sample code here.]&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9684</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9684"/>
		<updated>2009-01-07T16:57:07Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Implementation Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which should not require the addition of copper wire and has been corrected and improved in other ways, but has &amp;#039;&amp;#039;not&amp;#039;&amp;#039; been tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9683</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9683"/>
		<updated>2009-01-07T16:54:46Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Implementation Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9682</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9682"/>
		<updated>2009-01-07T16:54:03Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9681</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9681"/>
		<updated>2009-01-07T16:48:56Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Component Selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [Valentine], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [Valentine].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9680</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9680"/>
		<updated>2009-01-07T16:48:31Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9679</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9679"/>
		<updated>2009-01-07T16:48:00Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[http://hades.mech.northwestern.edu/wiki/index.php/Image:Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Perry&amp;quot;&amp;gt;Perry&amp;#039;s Handbook, Sixth Edition, McGraw-Hill Co., 1984.&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9678</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9678"/>
		<updated>2009-01-07T16:39:21Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Implementation Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[Hbridge_v4|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9677</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9677"/>
		<updated>2009-01-07T16:36:45Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
The board shown in the picture has been succeeded by this board [[Hbridge_v4.pcb|H bridge PCB file]], which has been corrected and improved, but &amp;#039;&amp;#039;not&amp;#039;&amp;#039; tested.  Use at your own risk.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=File:Hbridge_v4.pcb&amp;diff=9676</id>
		<title>File:Hbridge v4.pcb</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=File:Hbridge_v4.pcb&amp;diff=9676"/>
		<updated>2009-01-07T16:30:32Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: This is a PCB for a 40Amp, 24V H-bridge.  This is the second version of the board.  The first one worked, but this one hasn&amp;#039;t been ordered or tested yet.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a PCB for a 40Amp, 24V H-bridge.  This is the second version of the board.  The first one worked, but this one hasn&amp;#039;t been ordered or tested yet.&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9675</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9675"/>
		<updated>2009-01-07T16:13:39Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Implementation Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because it draws a great deal of current causing dips and spikes in the power supply, and more significantly, when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt).&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9674</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9674"/>
		<updated>2009-01-07T16:12:12Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Component Selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because &lt;br /&gt;
&lt;br /&gt;
1.it can draw a great deal of current causing dips and spikes in the power supply&lt;br /&gt;
&lt;br /&gt;
2.when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt)&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is unnecessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
Most power mosfets have an integrated Free Wheeling Diode (FWD), but is worth noting here that without these diodes, the inductive voltage spikes will destroy the mosfets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9673</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9673"/>
		<updated>2009-01-07T16:07:06Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time ([[Pulse Width Modulation|PWM]]=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because &lt;br /&gt;
&lt;br /&gt;
1.it can draw a great deal of current causing dips and spikes in the power supply&lt;br /&gt;
&lt;br /&gt;
2.when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt)&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is not necessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9672</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9672"/>
		<updated>2009-01-07T15:36:57Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Component Selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time (PWM=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because &lt;br /&gt;
&lt;br /&gt;
1.it can draw a great deal of current causing dips and spikes in the power supply&lt;br /&gt;
&lt;br /&gt;
2.when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt)&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is not necessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Opto-isolators | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9652</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9652"/>
		<updated>2009-01-06T17:54:29Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Component Selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time (PWM=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because &lt;br /&gt;
&lt;br /&gt;
1.it can draw a great deal of current causing dips and spikes in the power supply&lt;br /&gt;
&lt;br /&gt;
2.when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt)&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is not necessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Photodiodes and Phototransistors | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Comparators|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9651</id>
		<title>Driving a high current DC Motor using an H-bridge</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Driving_a_high_current_DC_Motor_using_an_H-bridge&amp;diff=9651"/>
		<updated>2009-01-06T17:53:06Z</updated>

		<summary type="html">&lt;p&gt;ErikChubb: /* Component Selection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
An H-bridge is a common circuit used to control the speed and direction of a brushed DC motor.  The convenience of an H-bridge is that a low current PWM signal can be used to control a high current motor (or other device).  Full H-bridge circuits capable of a few Amps can be purchased in convenient IC packages (see [[Pulse_width_modulation|PWM and H-bridge chips]]).  The H-bridge described in this write-up is capable of currents up to about 40A at 24V.  &lt;br /&gt;
&lt;br /&gt;
In the circuit diagram we see that the 4 mosfets surrounding the motor form an “H” shape.  The mosfets are used as switches and are activated in diagonal pairs.  To apply a forward voltage across the motor, mosfets 1=4=on and 2=3=off, causing the motor to spin in the forward direction ([[Pulse Width Modulation|PWM]]=100% duty cycle).  To make the motor spin in reverse, 1=4=off and 2=3=on (PWM=0% duty cycle).&lt;br /&gt;
&lt;br /&gt;
To keep the motor stationary, forward voltage is applied half of the time and reverse voltage is applied half of the time (PWM=50% duty).  If the voltage reversals are at a high enough frequency, the cycling is unnoticeable.  Generally 20kHz is a good choice for PWM frequency because it is well beyond of the dynamic range of motors and just beyond the range of human hearing.  For more information on PWM, see [[Driving a DC Motor using PWM]] and [[Pulse Width Modulation]].&lt;br /&gt;
&lt;br /&gt;
While the concept of a high current H-bridge is fairly simple, many practical considerations complicate implementation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge schem v1.jpg|900px]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ List of Unspecified Parts&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Component&lt;br /&gt;
! align=&amp;quot;left&amp;quot; | Value/Part#&lt;br /&gt;
|-&lt;br /&gt;
| MOSFETS || STP80NF55-08  (80A 55V)&lt;br /&gt;
|-&lt;br /&gt;
| Half Bridge Driver || IR2109&lt;br /&gt;
|-&lt;br /&gt;
| DC to DC converter || VBSD1-S24-S12-SIP (24V to 12V)&lt;br /&gt;
|-&lt;br /&gt;
| Regulator || 78L05 (5V)&lt;br /&gt;
|-&lt;br /&gt;
| Inverters || SN74HC14N&lt;br /&gt;
|-&lt;br /&gt;
| Optoisolator || 4N270545K&lt;br /&gt;
|-&lt;br /&gt;
| C_B || 0.1 uF&lt;br /&gt;
|-&lt;br /&gt;
| R_G || 4.7 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| R_PD || 2.2 k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The example H-bridge above works with a 24V supply and all of the specified components.  If you need to change a component, it is very likely that the other components will need to be re-sized.  Some rules-of-thumb for each component are provided below.&lt;br /&gt;
&lt;br /&gt;
== Implementation Considerations ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Noise&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The motor can create significant electrical noise because &lt;br /&gt;
&lt;br /&gt;
1.it can draw a great deal of current causing dips and spikes in the power supply&lt;br /&gt;
&lt;br /&gt;
2.when the mosfets abruptly cut off the current, the motor&amp;#039;s inductance creates voltage spikes (as predicted by: V = L*di/dt)&lt;br /&gt;
&lt;br /&gt;
To prevent the noise from having a deleterious effect on the mosfets, there is significant capacitance in close proximity to the mosfets.  The diodes (that often come integrated into the mosfets) also play an important role here.  If the motor is being driven forward (1=4=on) and then all mosfets are turned off, there will be a voltage spike due to the inductance of the motor.  This spike can dissipate by drawing current through the diodes in mosfets 1 and 3, effectively sending the current into the capacitors and battery.&lt;br /&gt;
&lt;br /&gt;
It is also possible to reduce the inductive voltage spikes by &amp;#039;&amp;#039;increasing&amp;#039;&amp;#039; the time it takes to transition between states.  This can be accomplished by increasing the Gate Resistance (covered later).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shoot Through&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is important to ensure that the two mosfets on the same half-bridge are never on at the same time.  This condition called “shoot through”, shorts the power supply and will likely damage the mosfets.  The IR2109 half bridge driver chip contains logic to prevent this condition from occurring.  It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate.  To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where &amp;#039;&amp;#039;both&amp;#039;&amp;#039; signals are low.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;High Mosfet Gate Voltage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To turn an N-channel mosfet to its “on” state, it is necessary to raise its gate voltage (Vgs) 2-10V above the source voltage (note that the pins on a N-channel mosfet are deceivingly named: the low-voltage side of the [[Diodes and Transistors|mosfet]] is the “source”).   In our example this means that when the high mosfet is turned on the voltage at the source pin (the high side of the motor) is 24V so the voltage at the gate must be about 34V.  The half-bridge driver chip is able to supply this high voltage by using a bootstrapping circuit.  &lt;br /&gt;
&lt;br /&gt;
The bootstrapping method for achieving the high mosfet gate voltages avoids the need for an additional DC to DC power supply, but for the bootstrapping to work, there needs to be time to recharge the bootstrapping capacitor.   That means that this H-bridge cannot be run at 0% or 100% duty cycle.  At 20kHz, the maximum forward and reverse speeds occur at about 10% and 90% duty cycle.&lt;br /&gt;
&lt;br /&gt;
The gate for a mosfet acts like a capacitor, and once the “gate charge” is reached, the mosfet is in its “on” state.  Gate charge can be found on the data sheet and is usually in the units of nanocoulombs (nC).  To estimate the half-bridge driver current demand we only need to consider how many times this charge will be applied each second.&lt;br /&gt;
 &lt;br /&gt;
Half_Bridge_Driver_Current (A) = Gate_Charge (C) * PWM_freq (Hz)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PCB Current Capability&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is possible to get a printed circuit board (PCB) made with very thick traces, but it is often &amp;#039;&amp;#039;significantly&amp;#039;&amp;#039; cheaper to stick with copper trace weight of 1oz/ft^2. Based on a [http://www.4pcb.com/index.php?load=content&amp;amp;page_id=95 Trace Width Calculator] the 0.340&amp;quot; tracks on the included PCB file can handle about 20 Amps.  To increase its current carrying ability, we soldered 14AWG solid copper wire in parallel with the high-current PCB traces.&lt;br /&gt;
&lt;br /&gt;
[[Image:Hbridge PCB top view.JPG|right|400px|Soldering wire to the PCB can improve current carrying capability]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Energy Dissipation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Significant energy is dissipated by the mosfet whenever the gate is not fully on or fully off.  This causes heating problems and reduces efficiency.  Energy dissipation can be minimized by making quick transition between the off and on states.  It can also be minimized by reducing the PWM frequency.  The lower the PWM frequency, the less transitions there are in a given time period, unfortunately it is generally necessary to set the PWM frequency above 18kHz to make it inaudible.&lt;br /&gt;
&lt;br /&gt;
== Component Selection ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MOSFETS&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The example H-bridge uses N-channel mosfets.  IGBTs can also be easily used.  P-channel mosfets are often used for the high mosfets in an H-bridge, but there is a cost penalty [ref], and it is not necessary because there are many half-bridge driver chips set up for N-channel mosfet half-bridges.&lt;br /&gt;
&lt;br /&gt;
It is advisable to pick a mosfet that is rated for &amp;#039;&amp;#039;twice&amp;#039;&amp;#039; the expected voltage and current [ref].  In the example H-bridge, the battery is 24V and predicted stall current was ~50A, when we used Mosfets rated for 30V we regularly had catastrophic failures.  55V, 80A mosfets were a much more robust solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boot Strapping Capacitor (C_B)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The bootstrapping capacitor should be sized large enough such that it can provide enough charge to keep the gate on for the duration of the PWM duty cycle.  &lt;br /&gt;
&lt;br /&gt;
Since the example circuit does not have a watchdog functionality, it is also necessary to make sure the bootstrapping capacitor is not too large.  If the bootstrapping capacitor is too large and the mosfet is held in the on state for a long period of time, the capacitor will slowly discharge and Vgs will slowly transition from 10V to 0V.  Since the micro-controller keeps the motor stationary by maintaining a 50% duty cycle, this condition can easily occur when the micro-controller is reset and a 0% duty cycle (full reverse) is sent to the H-bridge.  The most noticeable effect is that powering down the micro-controller will cause the motor to lurch in reverse.  Also, keeping Vgs in the half-on state for a long period can damage the mosfet because the large voltage drop between the drain and the source will dissipate significant energy.&lt;br /&gt;
&lt;br /&gt;
In general, increasing the mosfet “gate charge” will necessitate an increase in the Cb value.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gate Resistors (R_G)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is generally important to have crisp transitions between the off and on states of the mosfet so that it does not spend significant time in its half-on state dissipating energy.  Unfortunately, it can also be detrimental to switch the state too quickly for two reasons:  1. the more quickly the current is cut off, the larger the inductive voltage spikes (V=L*di/dt).  2. mosfet data sheets often specify a maximum “dv/dt” rating that refers to the maximum allowable time derivative of Vgs.&lt;br /&gt;
&lt;br /&gt;
To prevent the mosfet from switching too quickly, a small amount of gate resistance is added (usually 2-50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt;) to increase the time it takes to charge the mosfet gate.  If a mosfet with larger gate charge is used, it is sometime necessary to reduce the gate resistance in order to achieve similar switching times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pull Down Resistors (R_PD)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some gate drivers require pull down resistors (R_PD).  The IR2109 works without them at the intended frequency of operation, but during robustness tests, where frequency was swept from 1Hz to 200kHz and duty cycle from 0% to 100%, we found that the pull down resistors consistently turned off the gates while the IR2109 alone sometimes failed.&lt;br /&gt;
&lt;br /&gt;
Lower valued pull down resistors generally improve gate-turn-off consistency, but necessitate a larger boot strapping capacitor since current is continually leaked to ground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Power Capacitors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the example H-bridge we have two 2200uF capacitors to smooth out the power supply voltage and two 4.7uF ceramic capacitors to smooth out the ultra-high frequency noise on the power supply.  The power supply and the wiring to the H-bridge have a non-zero impedance.  Without large power capacitors near the mosfets, voltages on the gate, drain and source connections cannot be maintained as desired and the mosfets will over heat or experience catastrophic failures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Optocoupler and Inverters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prevent the noisy H-bridge circuit from affecting the other circuits in the system, the PWM input to the H-bridge is optically isolated.  Since the [[Photodiodes and Phototransistors | optocoupler]] does not produce a square wave with crisp transitions, it is advisable to add a [[Operational Amplifiers (Op-Amps)|comparator]].  In our example we needed an inverter chip for the second half-bridge so we used an inverter as a comparator.  Even without optical isolation, it is wise to including these two inverters to ensure crisp, unambiguous transitions between states.&lt;br /&gt;
&lt;br /&gt;
== Heat Sinking ==&lt;br /&gt;
To achieve the amperage rating on a mosfet it is necessary to heat sink it. The heat sink tab on the mosfet is often electrically connected to the drain so it is necessary to electrically isolate the mosfet from the heat sink (often a piece of aluminum).  To ensure electrical isolation from the heat sink, a &amp;quot;heat pad&amp;quot; can be purchased to provide a thermally conductive, electrically insulating layer (Ex: part# BER114-ND works for the TO-220 mosfet package).  To keep the metal screw from creating an electrical connection, an insulating shoulder washer/bushing (Ex: 3049K-ND) should be used.  It is advisable to improve heat transfer using Silicone Heat Transfer Compound (also electrically insulating and thermally conductive).  More information on heat sinking is in this article:[[Driving using a single MOSFET]].&lt;br /&gt;
&lt;br /&gt;
[[Image:PCB_heat_sinking.jpg|left|600px|The parts needed to heat sink a TO-220 mosfet.]]&lt;br /&gt;
&lt;br /&gt;
==Summary of Recommended Improvements==&lt;br /&gt;
&lt;br /&gt;
-Add a watchdog circuit to shut down the half-bridge drivers when the PWM signal is missing.  There is a &amp;quot;shut down&amp;quot; pin on most half bridge drivers.  This would be a generally good idea and allow the bootstrapping capacitor to be set to a large value.&lt;br /&gt;
&lt;br /&gt;
-Instead of bootstrapping to achieve high voltages, use an isolated DC power supply.  This would allow the full range of duty cycles from 0-100%.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Valentine, Richard, &amp;quot;Motor Control Electronics Handbook&amp;quot;&lt;/div&gt;</summary>
		<author><name>ErikChubb</name></author>
	</entry>
</feed>