Controlling a Motor with PWM

  • Thread starter Mcikegami
  • Start date
  • #1
5
0
Hey all,
I'm a junior in high school building an ROV for the MATE ROV competition with a amateur robotics team this year. For this year's competition, we've decided to control our bot via an Arduino Mega, and we're using PWM to potentiate the thrusters. As the person designated to electrical, I fortuitously have no idea how to set up an intermediate step from the Arduino to our thrusters. I've looked into H-Bridges with both Relays and Transistors, and defaulted to the transistor. How would I choose what transistor to use though? I've tried several (all BJTs) and they're giving me nothing but problems. Should I switch to a FET? Should I use a P type and an N type, or only one? What specs should I purchase them with? Do I ask too many questions? Help!

(I'm trying to control a 12V 6A motor with a 5V Pwm signal. Thanks!)
 

Answers and Replies

  • #2
4,662
5
You did not say whether you want unidirectional or bidirectional motor control. An H bridge is a necessity for bidirectional control. Another consideration is motor braking when the throttle is turned down. You might find this article on a simple PWM circuit useful for unidirectional motor control. You will probably need an intermediate transistor (common emitter) to get more than a 5 volt voltage swing to drive the mosfet.

http://www.solorb.com/elect/pwm/pwm2/

Bob S
 
Last edited:
  • #3
5
0
Thanks for your quick reply! I'm actually in need of bidirectional control. Our team purchased some NPNs that we thought would work, but when we integrated them into a circuit, they blew up. Could that perhaps be a problem with amperage and voltage?
 
  • #4
595
0
If you're going single-direction (don't need to reverse) a simple open collector transistor, pulling the motor down to ground, is probably all you need. Lookup "common emitter" circuits. They look like the output section of the schematics ref'ed by Bob S above, you can use a "regular" bipolar transistor or an "enhanced N channel" FET mostly interchangeably.

If you need to reverse the motor you will need an H-bridge. The L298N chip will handle two channels at around 2A max and can be easily run from a micro-controller.

I don't (yet) use the Arduino, but it should have some PWM stuff built-in. Most controllers have Timers that can be configured to automagically put out PWM pulses in hardware so all you have to do is set it up and let it go. Or you can do it by hand with a regular timer interrupt at a rate around 1-10Khz and a couple counters.

good luck!
 
  • #5
5
0
If you need to reverse the motor you will need an H-bridge. The L298N chip will handle two channels at around 2A max and can be easily run from a micro-controller.

I love the idea of a motor driver, but I need it to handle 6 amps. Any suggestions?
 
  • #6
4,662
5
First, tell us a little more about your PWM signal. Do you want proportional speed control. or only ON/OFF? Do you want full forward at 100% PWM, stop at 50% PWM, and full reverse at 0% PWM, or do you have a separate forward/reverse signal, and the PWM signal controls only the motor speed, but not direction? What frequency is your PWM signal, and what is the PWM range (0% to 100%)? Is there any situation where you want the motor OFF or COAST?

Because the motor runs off 12 volts, you cannot drive the H-bridge switches directly with the 5-volt signal. A good interface chip is the SN754410. This chip is suitable for driving 4 discreet MOSFET ICs running on 12 volts from a TTL level signal.

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

This chip has 4 Darlington NPN/PNP outputs suitable for driving two full H-bridge drivers.

[added] The L298 is similar, and also has a enable/disable control to turn the motor off. See

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000240.pdf

Bob S
 
Last edited:
  • #7
5
0
They are designed to work off of two separate signals per motor. And speed is intended to be controlled proportionally. So yes, each PWM signal only controls speed.
 
  • #8
4,662
5
Hi Mcikegami-
What are the two separate signals? Are they 1) forward/reverse and 2) speed, or something else? Is the PWM signal only for speed and not direction?

Bob S
 
  • #9
595
0
oops....duh, I didn't read -- or absorb -- the "12v 6A motor" part of the original post...

Probably looking for H bridge schematics online will help. I expect one problem is just sequencing the signals correctly. You may need to account for on/off switching time when reversing, such that the two transistors on a leg are not conducting at the same time.

If you have a money-but-no-time budget you might look into servo motor controllers like the Geckodrive: http://www.geckodrive.com/

ps...that SN754410 chip looks pretty useful, thanks BobS!
 
  • #10
5
0
We're using one signal for forward, and another for reverse. Both have PWM on them to throttle each side of the H-Bridge independently.
 

Related Threads on Controlling a Motor with PWM

  • Last Post
Replies
7
Views
5K
  • Last Post
Replies
3
Views
3K
Replies
1
Views
5K
  • Last Post
Replies
1
Views
3K
Replies
2
Views
8K
Replies
9
Views
44K
  • Last Post
Replies
1
Views
2K
Replies
3
Views
2K
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
9
Views
7K
Top