Modifications

Sauter à la navigation Sauter à la recherche
8 612 octets ajoutés ,  18 avril 2012 à 11:02
Page créée avec « == Introduction == This Dual H-Bridge Motor Driver Shield, which based on H-bridge driver Chip L298N Motor Driver Integrated Circuit, is a usefull module for controlling of ... »
== Introduction ==
This Dual H-Bridge Motor Driver Shield, which based on H-bridge driver Chip L298N Motor Driver Integrated Circuit, is a usefull module for controlling of robotics and mechanics. It can drive two brushed DC motors or one 4-wire two-phase stepper motor. 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.Both motors can be driven simultaneously while set to a different speed and direction. All driver lines are diode protected from back EMF.


[[File:L298N_3.jpg]]

== Features ==
*<b>Light weight, small dimension</b>
*<b>Super driver capacity</b>
*<b>FWD protection</b>
*<b>Heavy load Heat sink</b>
*<b>Power selection switch</b>
*<b>4 pull up resistor switch</b>
*<b>2 DC motor/ 4 coil dual phrase stepper motor output</b>
*<b>Motor direction indication LED</b>
*<b>5V power indication LED</b>
*<b>4 standard mouting holes</b>

== Specifications ==
*<b>Driver: L298N</b>
*<b>Driver power supply: +6V~+35V</b>
*<b>Driver peak current: 2A</b>
*<b>Logic power output Vss: +5~+7V (internal supply +5V)</b>
*<b>Logic current: 0~36mA</b>
*<b>Controlling level: Low -0.3V~1.5V, high: 2.3V~Vss</b>
*<b>Enable signal level: Low -0.3V~1.5V, high: 2.3V~Vss</b>
*<b>Max drive power: 25W (Temperature 75 ℃)</b>
*<b>Working temperature: -25℃~+130℃</b>
*<b>Dimension: 60mm*54mm</b>
*<b>Driver weight: ~48g</b>

== Application Ideas ==
*<b>drive brushed DC motors</b>
*<b>drive 4-wire two-phase stepper motor</b>

== Cautions ==
<font color="red">
* Ensure that the positive and negative pole connected to the VMS and GND
* Input voltage not exceeding 35V
</font>

== Hardware Diagram ==
[[File:L298N_1.jpg]]

{| border="1" class="wikitable"
|-
| width="150px" align="center" | '''Port name'''
| width="100px" align="center" | '''Direction'''
| width="500px" align="center" | '''Description'''
| width="200px" align="center" | '''Usage'''
|- style="font-size: 90%"
| align="center" | '''VMS GND'''
| align="center" | /
| align="center" | connect to external power supply(6V~35V)
| rowspan="13" align="center" | ENA(ENB) connected to H state will enable MOTORA(MOTORB) IN1(IN3) connected to 5V and IN2(IN4) to GND MOTORA(MOTORB) will move clockwise IN1(IN3) connected to GND and IN2(IN4) to 5V MOTORA(MOTORB) will move Anti-clockwise if you cwant to control speed you can connect the ENA(ENB) to PWM.
|- style="font-size: 90%"
| align="center" | '''ENA'''
| align="center" | Input
| align="center" | TTL Compatible Enable Input:the L state disables the bridge A
|- style="font-size: 90%"
| align="center" | '''IN1'''
| align="center" | Input
| align="center" | TTL Compatible Inputs of the Bridge A
|- style="font-size: 90%"
| align="center" | '''IN2'''
| align="center" | Input
| align="center" | TTL Compatible Inputs of the Bridge A
|- style="font-size: 90%"
| align="center" | '''ENB'''
| align="center" | Input
| align="center" | TTL Compatible Enable Input:the L state disables the bridge B
|- style="font-size: 90%"
| align="center" | '''IN3'''
| align="center" | Input
| align="center" | TTL Compatible Inputs of the Bridge B
|- style="font-size: 90%"
| align="center" | '''IN4'''
| align="center" | Input
| align="center" | TTL Compatible Inputs of the Bridge B
|- style="font-size: 90%"
| align="center" | '''M)TORA'''
| align="center" | Output
| align="center" | Output of the Bridge A
|- style="font-size: 90%"
| align="center" | '''MOTORB'''
| align="center" | Output
| align="center" | Output of the Bridge B
|- style="font-size: 90%"
| align="center" | '''CSA(CSB)'''
| align="center" | /
| align="center" | use for testing electric current of Bridge A(Bridge B)
|- style="font-size: 90%"
| align="center" | '''UR1 UR2 UR3 UR4'''
| align="center" | /
| align="center" | pull-up resistor
|- style="font-size: 90%"
| align="center" | '''5V +5V'''
| align="center" | /
| align="center" | 5V output
|- style="font-size: 90%"
| align="center" | '''5V Chip Enable Jumper'''
| align="center" | /
| align="center" | if connected,5V chip will work.

|}
==Getting Started==
=== How to use Jumpers ===
*5V-Enable jumper:
When you connect the 5V-Enable,the 78M05 will output 5V to supply logic chip,if you take off,you must connect 5V to supply logic chip.
*Pull up resistor jumpers
Only if you connect IN1(IN2 IN3 IN4) to MCU which have ports of strong driving ability such as AVR,you can take off the jumpers.
=== How to connected to your control board ===
DC motor input port A has three pins,IN1,IN2 and ENA.IN1 and IN2 are digital ports which are used to control the direction of motor,ENA is usually connected to PWM port of control board to control the speed of motor,also it can be connected to digital port.
we can control the 4-wire stepping motor the same way as two DC motors with the signal form ENA,IN1,IN2 and ENB,IN3,IN4.

== Examples ==
=== Drive Two DC Motors ===
[[File:DC_motor.jpg]]

To do this Demo required:
*Hardware: two DC motors, one Arduino, one L298 Shield,external power supply.
*Software: Arduino IDE,program.
Connect Arduino and L298 shield according to program notes,then upload the sketch to the Arduino board.
<syntaxhighlight lang="Arduino">
int ENA=5;//connected to Arduino's port 5(output pwm)
int IN1=2;//connected to Arduino's port 2
int IN2=3;//connected to Arduino's port 3
int ENB=6;//connected to Arduino's port 6(output pwm)
int IN3=4;//connected to Arduino's port 4
int IN4=7;//connected to Arduino's port 7
void setup()
{
pinMode(ENA,OUTPUT);//output
pinMode(ENB,OUTPUT);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
digitalWrite(ENA,LOW);
digitalWrite(ENB,LOW);//stop driving
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);//setting motorA's directon
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);//setting motorB's directon
}
void loop()
{
analogWrite(ENA,255);//start driving motorA
analogWrite(ENB,255);//start driving motorB

}
</syntaxhighlight>
=== Drive Two phase 4-wire stepping motor ===
[[File:Step_motor.jpg]]

To do this Demo required:
*Hardware: one 4-wires stepping motors, one Arduino, one L298 Shield,external power supply.
*Software: Arduino IDE,program.
Firstly,we should use the multimeter to detect the 4 wires,the 2 wires which connected is a group.In this example,the red wire and gray wires are a group(call A group),the yellow wire and green wire are a group(call B group).Connect Arduino and L298 shield according to the picture above
and program notes,then upload the sketch to the Arduino board.
<syntaxhighlight lang="Arduino">
int ENA=2;//connected to Arduino's port 2
int IN1=3;//connected to Arduino's port 3
int IN2=4;//connected to Arduino's port 4
int ENB=5;//connected to Arduino's port 5
int IN3=6;//connected to Arduino's port 6
int IN4=7;//connected to Arduino's port 7

void setup()
{
pinMode(ENA,OUTPUT);
pinMode(ENB,OUTPUT);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
digitalWrite(ENA,HIGH);//enablae motorA
digitalWrite(ENB,HIGH);//enable motorB
}
void loop()
{/*In the way of 4 beats to drive the stepping motor,A group connected to motorA,B
B group connected to motorB,Suppose A representing the forward current of A group,
A- representing the reverse current of A group,B representing the forward current of B group,
B- representing the reverse current of B group.
this way run as follow:
AB A-B A-B- AB-
or
AB AB- A-B- A-B
*/
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
delay(10);
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
delay(10);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
delay(10);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
delay(10);
}
</syntaxhighlight>

== Resources ==
[http://www.geekonfire.com/wiki/index.php?title=File:L298_datasheet.pdf L298 datasheet]

== How to buy ==
Dual H-Bridge Motor Driver can be ordered through the GOF store. Its product page is located [http://www.geekonfire.com/index.php?main_page=product_info&cPath=50&products_id=48 here]
== Licensing ==
This documentation is licensed under the Creative Commons [http://creativecommons.org/licenses/by-sa/3.0/ Attribution-ShareAlike License 3.0] Source code and libraries are licensed under [http://www.gnu.org/licenses/gpl.html GPL/LGPL], see source code files for details.
29 917

modifications

Menu de navigation