• Aucun résultat trouvé

The L298 Dual Full-Bridge Driver (PDA Robot Motor Controller)

Dans le document PDA Robotics (Page 119-125)

• Operating supply voltage up to 46 V

• Total DC current up to 4 A

• Low saturation voltage

• Over temperature protection

• Logical ”0” Input voltage up to 1.5 V (high noise immunity) Figure 5.41 shows two of the three available packages that the L298 comes in. In this project, we are using the vertical package shown on the left.

PDA Robotics

96

PDA 05 5/30/03 11:35 AM Page 96

Description

The L298 is an integrated monolithic circuit in 15-lead Multiwatt and PowerSO20 packages. It is a high-voltage, high-current, dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC, and stepping motors. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together, and the corresponding external terminal can be used for the connection of an external sensing resistor.

An additional supply input is provided so that the logic works at a lower voltage, as is the case in PDA Robot. The logic supply comes from the 5 V regulator on the main board via the ribbon connector and the power supply, which drives the motors directly from the 6 V

bat-Chapter 5 / The Electronics

97 Figure 5.41

L298 packages.

Figure 5.42 L298 block diagram.

tery pack. The grounds are, and must be, connected (common ground).

The circuit’s block diagram is shown in Figure 5.42.

Maximum Ratings. The maximum ratings are shown in Figure 5.43.

I really like this chip because it will shut down if it is overloaded and becomes hot. It is a nasty sight (and smell) seeing a smoke plume when an overloaded component like a transistor melts down. The L298 can handle a respectable load for its compact size (3 amps, 25 watts). It might be overkill for the motors it drives in this project, but it also means that you can connect much more powerful motors if you decide to change the design. The enable feature and the 2-pin logic lines (with a wide voltage range of –0.3 to 7 V) per side makesa great logic interface. ST microelectronics and Protel provide the footprint and profile for use in the Protel 98 and Protel DXP circuit design pro-grams allowing you to simply drop the chip into your circuit design.

Figure 5.44a picture of the package we are using in the project show-ing the pin layout. The short pins are set forward, and the longer are to the back of the chip.

Table 5.5 Pin Descriptions

Pins Name Function

1,15 Sense A; Sense B Between this pin and ground is the sense resistor connected to control the current of the load.

2,3 Out 1; Out 2 Outputs of the Bridge A; the current that flows through the load connected between these two pins is monitored at pin 1.

(continued on next page) PDA Robotics

98

Figure 5.43 Maximum ratings.

PDA 05 5/30/03 11:35 AM Page 98

Table 5.5

Pin Descriptions (continued)

Pins Name Function

4 Vs Supply Voltage for the Power Output stages. A

noninductive 100nF capacitor must be connected between this pin and ground.

5,7 Input 1; Input 2 TTL Compatible Inputs of the Bridge A.

6,11 Enable A; EnableB TTL Compatible Enable Input: the L state disables the bridge A (enable A) and/or the bridge B (enable B).

8 GND Ground.

9 VSS Supply Voltage for the Logic Blocks. A100nF capacitor must be connected between this pin and ground.

10,12 Input 3; Input 4 TTL Compatible Inputs of the Bridge B.

13,14 Out 3; Out 4 Outputs of the Bridge B. The current that flows through the load connected between these two pins is monitored at pin 15.

Figure 5.45shows how to wire one side of the chip for bidirectional motor control. This is how the chip is wired in PDA Robot. Pins 10 and 12 are connected to Port B pins on the PIC16F876 that have been configured through the C code as outputs (see Chapter 7: Programming the PIC16F876 Microcontroller). In PDA Robot, the sense pins 1 and 15 are tied to the ground. We can feed this into one of the analog pins on the PIC16F876 and determine the current draw on the motors (explained below). If the motor is drawing too much current, shut it down. You can experiment with this. A command could be sent to the

Chapter 5 / The Electronics

99 Figure 5.44 L298 pin layout.

PDA Robotics

100 Figure 5.46 Paralleled channels for high current.

Figure 5.45 Bidirectional motor control. (C = 1 and D = 0 ) For ward, (C

= 0 and D = 1) Reverse, (C = D) Fast Motor Stop.

PDA 05 5/30/03 11:35 AM Page 100

robot to retrieve and forward this information to the PDA (like the range-finder information), where it can be displayed and analyzed. We could determine the speed of PDA Robot based on the current draw channel 1 with channel 4 and channel 2 with channel 3. Figure 5.46 shows how to accomplish this.

Power Output Stage. The L298 integrates two power output stages (A; B). The power output stage is a bridge configuration, and its out-puts can drive an inductive load in common or differential mode, depending on the state of the inputs. The current that flows through the load comes out from the bridge at the sense output. An external resistor (RSA; RSB) allows one to detect the intensity of this current.

Input Stage. Each bridge is driven by means of four gates, the input of which are In1; In2; EnA and In3; In4; EnB. The In inputs set the bridge state when the En input is high; a low state of the En input inhibits the bridge. All the inputs are TTL compatible.

Suggestions. A noninductive capacitor, usually of 100 nF, must be foreseen between both Vs and Vss to ground as near as possible to GND pin. When the large capacitor of the power supply is too far from the IC, a second smaller one must be near the L298. The sense resis-tor, not of a wire wound type, must be grounded near the negative pole of Vs that must be near the GND pin of the IC. Each input must be con-nected to the source of the driving signals by means of a very short path.

Turn on and turn off: Before you can turn on the supply voltage and to turn it off; the enable input must be driven to the low state.

Applications. The external bridge of diodes D1 to D4 is made of four fast recovery elements (trr 3 200 n) that must be chosen from a VF as low as possible at the worst case of the load current. The sense output voltage can be used to control the current amplitude by chopping the

Chapter 5 / The Electronics

101

inputs, or to provide overcurrent protection by switching the enable input to low.

The brake function (Fast motor stop) requires that the absolute maxi-mum rating of 2 amps must never be overcome. When the repetitive peak current needed from the load is higher than 2 Amps, a paralleled configuration can be chosen.

An external bridge of diodes is required when inductive loads are driven and when the inputs of the IC are chopped; Schottky diodes are preferred. This solution can drive until 3 amps in DC operation and until 3.5 amps of a repetitive peak current. The L298 is great for driv-ing a stepper motor. Figure 5.47 shows how this is accomplished when the current is controlled by a L6506.

Dans le document PDA Robotics (Page 119-125)