PDA

View Full Version : HWPWM and 4 motors



Macgman2000
- 3rd May 2006, 16:07
Hello,

I want to control 4 DC motors (single direction, no H-bridge) using 4 HWPWM outputs from a PIC. The PWM frequency is the same on all 4 outputs, the only thing that is different is duty cycle (since I want to change speed). I am also monitoring the BEMF from each motor commutation to "close the loop" and maintain set speed.

I looked at the 16F616, this is set up to drive 1/2 bridge or full bridge but does NOT allow all 4 HWPWM output at the same time. I would appreciate input from the group, if anyone has experience with this, your insight would be greatly appreciated!!!!

Best Regards,
Nick

mister_e
- 3rd May 2006, 21:29
At least, 4 possible solutions


1. Use 4 different PIC like 12F683 wich have PWM, ADC, and comparator available

2. Use one pic but no HPWM. You do your PWM signal using an TIMER interrupt. Once in the interrupt routine you just play with the duty delay of each outputs. Depending the frequency... it could work really well

3. Use external DAC converter OR digital pots.

4. Search for another PIC that allow 4 independant PWM... if it exist.

fanie
- 3rd May 2006, 23:16
Have a look at the 16F684...

Darrel Taylor
- 4th May 2006, 00:03
Hi Nick,

Taylor made to your request, 2 years in advance. :)

Multiple Slow speed Software PWM
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=12
<br>

Macgman2000
- 4th May 2006, 03:19
The 16F684 is a 1/2 or full bridge driver. It will only output PWM on 2 ports and give steering logic to activate an H-bridge (FWD / REV). Has anyone used it to put out 4 PWM signals? I don't think it is possible per spec sheet.

Best Regards,
Nick

Darrel Taylor
- 4th May 2006, 04:55
You are correct!

You can only get 2 PWM's from it.

The ECCP does have several outputs. But, they can not be configured to output different frequencies or PWM dutycycles.
<br>

fanie
- 5th May 2006, 00:15
If you want more PWM's have a look at the 18F2431 - sports up to 4 PWM's with complimentary outputs...

Darrel Taylor
- 5th May 2006, 00:44
Now that's a Cool chip.

I can't believe I haven't seen it before.

Wow, all those PWM's, and Capture channels.
Built in Quadrature Encoder Interface.
Super Fast A/D.

And everything else a good 18F would have.

Geez, where have I been..

Thanks fanie!
<br>

mister_e
- 5th May 2006, 02:44
I have to agree it's a nice PIC even if it's hundred times too big for a so simple task.

Sorry to be a pest but, the Darrel's Link or the interrupt based routine is still the cheapest solution and will learn you something.