Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can i use pwm to control dc motor ?

Status
Not open for further replies.

mahm150

Full Member level 1
Joined
Dec 14, 2010
Messages
98
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Cairo, Egypt, Egypt
Activity points
2,001
How can i use pwm to control dc motor ?
Any one have tutorial discuss pwm to control dc motor. I already try to do that by avr but i cant observe the difference of speed in the dc motor when change the value of the timers
 

Have you heard of a H-Bridge circuit? This would allow you to change the direction of rotation of the motor and at the same time if a MOSFET is placed in the ground path of the H-Bridge then you can connect the PWM to the gate of this MOSFET and use it to control the speed of rotation.
Google H-Bridge and see what comes up.

Pete
 

that's all best but i want to know when the PWM signal generated by controller give the max. speed, min speed and the medium speed
 

First you need to understand PWM properly. PWM means that you have a pulse at a specific frequency and the pulse has a duty cycle which determines the time during each pulse that it is high. So, you could have a pulse with frequency 50Hz (just for example). That means that it has a period of 20ms. So, if you have 10% duty cycle, the output pulse is on for 2ms and off for 18ms. If you have 80% duty cycle, the output pulse is on for 16ms and off for 4ms.

You have the minimum motor speed when the duty cycle is 0 or near 0. The maximum motor speed is when the duty cycle is 100% or near 100%. You get "medium" speed (50% speed) when duty cycle is 50%.

Hope this helps.
Tahmid.
 
how to do that with micro controller like AVR , i do that using fast PWM mode but i am not understand how to make calculation to timer to make the required duty cycle so my DC motor work with speed unknown for me
 

Let's say you're using Timer/Counter 2 and Fast PWM Mode. Then, TOP = 0xFF (255). Setting the OCR2 register will set the duty cycle. If you set OCR2 to 128, you get 50% duty cycle. If you set OCR2 to 64, you get 25% duty cycle.

Duty cycle = (OCR2/TOP) * 100%

Study pages 112 and 113 from the datasheet carefully. I've attached just these 2 pages as well.

Hope this helps.
Tahmid.
 

Attachments

  • pg112-113.pdf
    113.1 KB · Views: 110
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top