Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM and DC motor for mobile robot

Status
Not open for further replies.

bathong

New Member
I use CUBLOC CB280 (Atmega128) microcontroller. I connect the PWM pin to DC motor (one pin of motor to PWM pin, another to ground) but the motor donot run. I think I lost something, maybe DC motor cannot connect to microcontroller directly.
One more thing, PWM just change from 0V to 5V but I want to use 12V DC motor.
Thank you for your help.
 
Last edited:
bathong said:
I use CUBLOC CB280 (Atmega128) microcontroller. I connect the PWM pin to DC motor (one pin of motor to PWM pin, another to ground) but the motor donot run. I think I lost something, maybe DC motor cannot connect to microcontroller directly.

No it can't, and you may well have killed your ATMega!.
 
just use the L293D motor controller IC


IT solves everything. very simply! :D

You connect you 5-0 v output from one side and the motor from another side, power the IC with 5v, 12v and ground and Voila! you've got your motor running,

If the motor is drains more that 1 A, or of the motor driver L293d get hot, use L298, its the same but with higher protection and current cut-off to protect the IC itself from too high loads.
 
You are a first timer? No problem.

YOu need to use an H-bridge to produce the current capable of driving the require current through a motor (as you have realized, a uC cannot provide the current high enough to drive a motor). An H-bridge's purpose is to be able to switch the direction that current flows through the load (so you can control motor direction). The uC can switch on and off the transistors to control the larger flow of motor-level current. You PWM these inputs (and therefore produce a PWM in the motor current) to control motor speed.

A motor draws far too much current for a uC to drive directly. The H-bridge acts kind of like a relay (although capable of much faster switching, with control inputs low power enough to be directly driven by a uC pin, and able to control current direction through a load). It's similar to how you can use a low current to switch on and off a much larger current in a mechanical relay.

So, it doesn't matter if the uC PWM only goes from 0 to 5V. As long as this is enough to switch on and off the H-bridge transistors, you can use whatever power supply you want for the motor. Google H-bridges. As soon as you find a schematic, it should be fairly obvious which is the motor power supply and which is the logic supply.

You can use any switch you want, but for PWM to work you need to use transistors and not relays since relays can't switch fast enough (and die really fast with lots of switching).

Here's to get you started:
http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/index.html
http://www.4qdtec.com/bridge.html
 
Last edited:
and as an additional note to dknguyen, the L293D is an h-bridge in a single chip.

If you don't have to worry about building your own H bridge, use the L293D or the L298

if you will drive motors that drain more than 3 A, you are probably gonna have to build your own H bridge.
 
I had the motor driver board, MR-RM01 using L298N (2 motors, 2A). So I can PWM motors to control the speed by this board. Is it right?
Thank you very much.
 
Last edited:
dknguyen said:
You are a first timer? No problem.

YOu need to use an H-bridge to produce the current capable of driving the require current through a motor (as you have realized, a uC cannot provide the current high enough to drive a motor). An H-bridge's purpose is to be able to switch the direction that current flows through the load (so you can control motor direction). The uC can switch on and off the transistors to control the larger flow of motor-level current. You PWM these inputs (and therefore produce a PWM in the motor current) to control motor speed.

So, it doesn't matter if the uC PWM only goes from 0 to 5V. As long as this is enough to switch on and off the H-bridge transistors, you can use whatever power supply you want for the motor. Google H-bridges. As soon as you find a schematic, it should be fairly obvious which is the motor power supply and which is the logic supply.
You mean that PWM change the input voltage, through H-bridge change the current.
 
bathong said:
I am sorry, I donot understand what you mean. Can you write the detail?
@dknguyen: Do you think this article is useful for my motor driver board?
http://www.robotbuilder.co.uk/Resour...icles/152.aspx
Thank you.
If your motor control board can handle the current that the motor draws, then you can the motor control board to PWM the motor.

THat diagram is useful if you were working witth the LM298 directly, but you said the LM298 was already on a MR-RM01 control board right? That means that the LM298 could be "insulated" from the "outside world". You should read up on the MR-RM01 control board rather than the LM298.

bathong said:
You mean that PWM change the input voltage, through H-bridge change the current.
I mean the PWM input signal will PWM the motor voltage. The motor will see the average of this PWM'd motor voltage and draw the current based on this averaged voltage.
 
Last edited:
dknguyen said:
If your motor control board can handle the current that the motor draws, then you can the motor control board to PWM the motor.

THat diagram is useful if you were working witth the LM298 directly, but you said the LM298 was already on a MR-RM01 control board right? That means that the LM298 could be "insulated" from the "outside world". You should read up on the MR-RM01 control board rather than the LM298.


I mean the PWM input signal will PWM the motor voltage. The motor will see the average of this PWM'd motor voltage and draw the current based on this averaged voltage.
Thank you very much.
I will check my board.
 
L298

if anybody know Y
the l298
it's very hot, even only 1 A is drawn
moreover in case of no load it's also hot
 
she7ataz said:
if anybody know Y
the l298
it's very hot, even only 1 A is drawn
moreover in case of no load it's also hot

Create your own thread or people won't see your question to answer it.

How hot is very hot? What might feel hot to you may be normal for the LM298. Can you not keep your finger on the chip for very long without burning your finger?

Is the heatsink tab hot? Because the heatsink tab should be hot if it's dissipating heat.

Try another LM298. It may be been damaged from manufacture (unlikely) or abused (likely). Or just attach a heatsink if you are lazy.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top