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.

Generating PWM

Status
Not open for further replies.

strantor

Active Member
Hello, looking for ideas here. I am making a medium sized DC motor controller, driving 6 MOSFETs in parallel (each with their own driver). It is not an H-bridge, just simple single low side switch. I want to PWM the motor @ 20khz. I was originally going to do this with my Arduino until I read that it only does PWM @ 500Hz. So now I'm looking for other ideas. I want to have current limiting.
I read here (section 7.1) that a triangle wave generator and comparator can make PWM waveforms. I have a DAC chip I can use with my arduino to provide an analog reference to the comparator to vary the duty cycle. for current limiting, I was thinking I could run the PWM output of the comparator through a transistor, then to the drivers. The arduino would monitor current via a hall sensor an turn off the transistor if current goes above X Amps. Do you think the arduino would be too slow to catch the overcurrent and cut off PWM? Does that sound like too much of a kludge?
Any other Ideas? Someone else suggested using a PIC and I looked at the datasheet for the dspic33f and it mentions PWM @ 39.1KHz but I have never set eyes on a PIC, and I already have my hands full trying to learn all this motor control stuff. It would be nice if I didn't have to tackle learning PICs in the same project. I guess I might not be able to get around that though. How hard is it to use a PIC for this (I find Arduino to be fairly easy; the language makes sense to me) ? Is there a simpler way?
 
Couldn't you use the trusty old 555 PWM circuit to drive your MOSFETs? The circuit is all over the web (probably found here too), and generates a variable-duty-cycle square wave. I'm sure it'll work up to 20KHz (not positive, but someone will be along shortly to confirm or deny, no doubt).

Unless I'm missing something really obvious here ...
 
I had thrown the 555 idea right out the window in the first, because I read somewhere that it wasn't capable of going from 0-100% duty cycle (something like 15% to 85%). But I must have gotten my info mixed up because further reading just now said nothing about that. I will look further into it. Thanks!
 
The 555 generally has that problem (inability to reach 0% and 100% duty cycle), but there are some kluges you can use to get around it.
 
Try this one. It needs a reverse diode across the motor.

**broken link removed**
 
crisis averted; I figured out how to make my arduino go up to 31khz so no more need for a circuit. Thanks for the suggestions guys.
 
Could you please tell me how to generate PWM upto 31khz using aurdino???? it is urgent please help...My PWM is based on the comparison of reference wave with sawtooth or triangular wave...and my carrier frequency is 10 Khz....Is it possible for me to generate the PWM waveform for this? my duty cycle is unknown because of closed loop operation.
 
Could you please tell me how to generate PWM upto 31khz using aurdino???? it is urgent please help...My PWM is based on the comparison of reference wave with sawtooth or triangular wave...and my carrier frequency is 10 Khz....Is it possible for me to generate the PWM waveform for this? my duty cycle is unknown because of closed loop operation.

This thread is a year and a half old. You should start your own thread instead of hijacking someone else's.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top