Dc Motor Control With Hip4082

Dc Motor Control With Hip4082 Average ratng: 3,8/5 5344 reviews
  • Arduino Tutorial
  • Arduino Function Libraries
  • Arduino Advanced
  • Arduino Projects
  • Arduino Sensors
  • Motor Control
  • Arduino And Sound

The MD04 24V 20A H-Bridge USB DC Motor Driveris a medium power motor driver and is an upgraded replacement for the MD03, the main features are ease of use and flexibility. It can be controlled by analog voltage, PWM, RC mode, Serial and I2C Interfaces. Control 1 - 0v - 2.5v - 5v Analogue for Reverse - Stop. The HIP4082 DC/AC Evaluation Board (subsequently referred to as the “eval-board”) featuring the HIP4082 is one way to increase the performance, while reducing cost of DC to AC conversion. The topology chosen uses the HIP4082 to provide a 60kHz, low voltage, square-wave to drive a small isolation power transformer.

  • Arduino Useful Resources
  • Selected Reading

In this chapter, we will interface different types of motors with the Arduino board (UNO) and show you how to connect the motor and drive it from your board.

There are three different type of motors −

  • DC motor
  • Servo motor
  • Stepper motor

A DC motor (Direct Current motor) is the most common type of motor. DC motors normally have just two leads, one positive and one negative. If you connect these two leads directly to a battery, the motor will rotate. If you switch the leads, the motor will rotate in the opposite direction.

Warning − Do not drive the motor directly from Arduino board pins. This may damage the board. Use a driver Circuit or an IC.

We will divide this chapter into three parts −

  • Just make your motor spin
  • Control motor speed
  • Control the direction of the spin of DC motor

Components Required

You will need the following components −

  • 1x Arduino UNO board
  • 1x PN2222 Transistor
  • 1x Small 6V DC Motor
  • 1x 1N4001 diode
  • 1x 270 立 Resistor

Procedure

Follow the circuit diagram and make the connections as shown in the image given below.

Precautions

Take the following precautions while making the connections.

  • First, make sure that the transistor is connected in the right way. The flat side of the transistor should face the Arduino board as shown in the arrangement.

  • Second, the striped end of the diode should be towards the +5V power line according to the arrangement shown in the image.

Spin ControlArduino Code

Code to Note

The transistor acts like a switch, controlling the power to the motor. Arduino pin 3 is used to turn the transistor on and off and is given the name 'motorPin' in the sketch.

Result

Motor will spin in full speed when the Arduino pin number 3 goes high.

Motor Speed Control

Following is the schematic diagram of a DC motor, connected to the Arduino board.

Arduino Code

Code to Note

The transistor acts like a switch, controlling the power of the motor. Arduino pin 3 is used to turn the transistor on and off and is given the name 'motorPin' in the sketch.

When the program starts, it prompts you to give the values to control the speed of the motor. You need to enter a value between 0 and 255 in the Serial Monitor.

In the 'loop' function, the command 'Serial.parseInt' is used to read the number entered as text in the Serial Monitor and convert it into an 'int'. You can type any number here. The 'if' statement in the next line simply does an analog write with this number, if the number is between 0 and 255.

Result

The DC motor will spin with different speeds according to the value (0 to 250) received via the serial port.

Spin Direction Control

To control the direction of the spin of DC motor, without interchanging the leads, you can use a circuit called an H-Bridge. An H-bridge is an electronic circuit that can drive the motor in both directions. H-bridges are used in many different applications. One of the most common application is to control motors in robots. It is called an H-bridge because it uses four transistors connected in such a way that the schematic diagram looks like an 'H.'

We will be using the L298 H-Bridge IC here. The L298 can control the speed and direction of DC motors and stepper motors, and can control two motors simultaneously. Its current rating is 2A for each motor. At these currents, however, you will need to use heat sinks.

Components Required

You will need the following components −

  • 1 × L298 bridge IC
  • 1 × DC motor
  • 1 × Arduino UNO
  • 1 × breadboard
  • 10 × jumper wires

Procedure

Following is the schematic diagram of the DC motor interface to Arduino Uno board.

The above diagram shows how to connect the L298 IC to control two motors. There are three input pins for each motor, Input1 (IN1), Input2 (IN2), and Enable1 (EN1) for Motor1 and Input3, Input4, and Enable2 for Motor2.

Since we will be controlling only one motor in this example, we will connect the Arduino to IN1 (pin 5), IN2 (pin 7), and Enable1 (pin 6) of the L298 IC. Pins 5 and 7 are digital, i.e. ON or OFF inputs, while pin 6 needs a pulse-width modulated (PWM) signal to control the motor speed.

The following table shows which direction the motor will turn based on the digital values of IN1 and IN2.

IN1IN2Motor Behavior
BRAKE
1FORWARD
1BACKWARD
11BRAKE

Pin IN1 of the IC L298 is connected to pin 8 of Arduino while IN2 is connected to pin 9. These two digital pins of Arduino control the direction of the motor. The EN A pin of IC is connected to the PWM pin 2 of Arduino. This will control the speed of the motor.

To set the values of Arduino pins 8 and 9, we have used the digitalWrite() function, and to set the value of pin 2, we have to use the analogWrite() function.

Connection Steps

  • Connect 5V and the ground of the IC to 5V and the ground of Arduino, respectively.
  • Connect the motor to pins 2 and 3 of the IC.
  • Connect IN1 of the IC to pin 8 of Arduino.
  • Connect IN2 of the IC to pin 9 of Arduino.
  • Connect EN1 of IC to pin 2 of Arduino.
  • Connect SENS A pin of IC to the ground.
  • Connect Arduino using Arduino USB cable and upload the program to Arduino using Arduino IDE software.
  • Provide power to Arduino board using power supply, battery, or USB cable.

Arduino Code

Result

The motor will run first in the clockwise (CW) direction for 3 seconds and then counter-clockwise (CCW) for 3 seconds.

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Sensors, Actuators, and Robotics » Driving a DC Motor in Making or Buying an H-Bridge

NerdKits » Forums » Sensors, Actuators, and Robotics » Driving a DC Motor in Making or Buying an H-Bridge (10 posts)
April 19, 2010
by mosfet

Hi all,

I need an H-bridge to run a dc motor both directions. The basics of the H-bridge seem trivial and very cool: H-bridge at Wikipedia. But it seemed less trivial where the flyback diodes should go.

Driving a motor in a single direction is simple enough with the flyback diode shorting the momentary high voltages across the motor:

But with an H-bridge, the application of flyback diodes seemed less trivial. But I've found this article, and they get to flyback diodes toward the bottom, just before the last image. The arrangement of flyback diodes is cool; try going through the through the thought experiments of the motor being turned off from running each direction. Even cooler, is that it seems the mosfet's built-in diodes handle this.

Now to actually implement this, I'm looking for assistance on what components to buy. The article mentions that 'N-Channel Mosfets are much cheaper than P-Channel Mosfets'. So does it make more sense to buy a pair of P-Channel mosfets or just an H-bridge chip?

I plant to PWM my motor at 12V. It's unlabeled and a little bigger than a 35mm film canister. It's very weak at 5v, but is decent at 12V. Brick source = 12.1V, while running motor voltage drops to 10.7V, using 185ma. ~2W.

Winpcsign pro crack download full movie. How does one select an H-bridge chip? The Intersil HIP4082 seems more than sufficient, based on voltage and current:http://www.intersil.com/products/deviceinfo.asp?pn=HIP4082&js=nhttp://www.intersil.com/data/FN/fn3676.pdfBut what's going on on page 3, 'Typical Application (PWM Mode Switching)'? It looks like

April 19, 2010
by mosfet

Well, that was a big oops. An accidental keystroke posted my message while I was editing the title and not done with the body. Ah well.

So, for bidirectional DC motor control, is the Intersil HIP4082 a decent choice? (given my motor info mentioned above).

And I'm confused by the 'Typical Application (PWM Mode Switching)' illustration on page 3 of the pdf. It looks like, connected to the load, there are somethings/mosfets(?) outside of the HIP4082 chip? I was hoping an H-bridge chip incorporated the 4 mosfets, and that just a pair of leads on the H-bridge chip would go to the pair of motor leads, giving you bidirectional motion.

Any help?

April 19, 2010
by mosfet

I've also stumbled upon the TI L293 and L293D and they seem like a simple lower-cost option:

http://focus.ti.com/lit/ds/symlink/l293.pdf

The L293D seems so appealing I'm about to buy one. The block diagram is on page 2 of the pdf. Here are my newbie guesses: It seems pin1 enables half-H's 1 & 2 to function. Half-H 1 seems to be controlled via on/off signal on pin2, creating output on pin3 of Vcc2-or-0V to motor lead. Half-H 2 seems to be controlled via on/off signal on pin7, creating output on pin6 of Vcc2-or-0v to other motor lead.

Please correct me wherever I'm clueless or off-base!

Also, it appears one must use external flyback/protection diodes with the L293. But it seems the L293D has flyback/protection diodes included. 'Output Clamp Diodes for Inductive Transient Suppression (L293D)'

The pdf makes it seem Vcc2 is the output voltage/supply, for all 4 Half-H outputs. Yes/no?

I'm confused, because this page makes it seem that Vcc1/pin16 is the output voltage/supply for Half-H's 1 and 2, and that Vcc2/pin8 is the output voltage/supply for Half-H's 3 and 4. Does this contradict the pdf?

And of course, what exactly is Vcc1 for?

For others' benefit, could someone post the L293/L293D's block diagram and logic diagram? I don't have a site to host captured pics.

Any help is greatly appreciated!Thanks!

April 19, 2010
by Rick_S

I've been messing around with L298's. As a matter of fact, I have one setup right now that I've been playing with stepper motors with. The L298 is a dual h-bridge with up to 2 amps output. My first test was to drive a simple hobby motor which worked great.

Since then, I've been playing with steppers driving the L298 with an L297 and a 555 timer. I'm just experimenting right now to get a feel for the chips. So far, I'm pleased. I got the L298's from a guy on e-bay for $4 each shipped.

Here's some pics of the setup.

I haven't tried the other bridges you mentioned, but this one works well.

Rick

April 19, 2010
by Rick_S

Oh, BTW, you aren't crazy, the website you referred to and the datasheet do contradict each other a bit, but then the datasheet contradicts itself on pages 4 & 5 where it says

And then in the table on page five says 4.5 min to 7v max.

It appears that VCC1 should be 5v for the logic portion of the chip and VCC2 would be the voltage for driving the motor(s).

Rick

April 19, 2010
by Rick_S

Here's another link on that site that seems to confirm my hypothesis. :)

April 19, 2010
by mosfet

L293/L293D: Quadruple Half-H Drivers. Bi-directional drive of 2 DC motors, or use for steppers, or.. And the PDIP package easily plugs into the breadboard.

After seeing a couple other pages on the L293/L293D, it seemed that Vcc1/pin16 was just logic power to the chip, and that Vcc2 supplies output voltage to motors for all four Half-H's. And that matches the other link you posted. (note 3A/3Y/4A/4Y can drive another bi-directional DC motor)

Another info source: The L293 Dual Bridge Motor Driver IC Pinouts

'Vss = Logic Supply = 4.5V to 36V. Vs = Motor Driver Supply = Vss to 36V'

The contradiction within the pdf is also in the newer version of the product (w/diff part number), but now I see that the values are different because the 36V is the absolute max for Vcc1, and 4.5-7V is the recommended range.

So I just bought a couple L293D's off eBay for $6 shipped for the pair. I'm dying to try the L293D out, as it seems like it'll be so easy to bi-directionally drive my DC motor.

April 20, 2010
by Rick_S

It does look like a nice chip for applications up to an ampere of current. I had looked at the L293 equivalent at sparkfun (SN754410) before getting the L298. I wanted to use it for not only controlling DC motors but primarily steppers. The L298 has current sensing outputs that can allow you to monitor and control the power output to the motor. If it weren't for the marriage of the L297, which uses the current sense and modifies a PWM signal to control output current, I may have opted for the L293 as well. I will agree with you also that the form factor of the L293(D)'s is much easier to deal with as well. I had to get creative to breadboard my L298 as you probably noticed in the photo's. :)

BTW, what are you building?? Anything interesting??

Hope it goes good.

Rick

April 20, 2010
by mosfet

Yes, I saw your proto/perf(?)board soldering to get your L298N breadboardable. I haven't done much soldering yet, so I'm glad the L293D seems to meet my power needs.

I think the L293 is rated up to 1A continuous, but the L293D (with protection diodes) is only rated to 0.6A/600mA continuous. But the L293 replacement, SN754410 (that you mentioned), has the protection diodes and* is rated to 1.1A continuous. I'd have gotten SN754410's had I known, and I still may. They're $2.50 shipped on ebay (4 for $9.99).

When needed output is higher than a chip can offer, I've seen IC piggybacking on ladyada's site to ~double output, just soldering one IC on top of another, pin-to-pin, pretty cool:

For basic stepper operation, does one just energize the coils in order, for a ~millisecond each? And for low torque apps, doesn't the aligned permanent magnet hold the unenergized stepper motor in place?

So your L298N senses current to each coil and outputs 4 signals (0-5V) back to the MCU? Or the L298N itself reads/uses the current sensed? What's the reasoning? Current indicating load, thus changing PWM output power?

Did you put a capacitor across ground and power into your L298N? How do you size these supply storage caps?

And what are the pair of thick hockey puck devices on 4 tall leads on the front of your breadboard?

I'm looking to PWM drive the carriage motor on a dismantled inkjet printer to get controlled linear motion via the timing belt and shaft linear guide. Couple options on what this turns into. I also want to drive some steppers for fun. These quadruple Half-H's seem sooo handy!

April 20, 2010
by Rick_S

The control output of the 298 is a voltage reference based on the current output of the bridge I believe it tops out at around 2v. There are two controls one for each bridge. The L297 reads this control and varies the on time of the pwm signal it drives the enable line of the bridge with. So by changing a few components, you can set it up to drive a motor efficiently.

Steppers are relatively simple to drive, you just sequence the different phase coils in order. The nice thing about the 297 is it does all this in itself and just needs a pulse to increment the motor. Right now I'm driving it with a 555 timer.

Torrent ave maria pascal obispo. The 4 hockey puck looking devices are bridge rectifiers (4 diodes in a single package). Normally used to turn AC into pulsed DC. However, here I'm using them as the flyback diodes.

Post a Reply

Please log in to post a reply.