Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

can multiple PWMs be controlled simultaneously by one PIC?

Status
Not open for further replies.

eetrit

Electrical
Aug 1, 2002
11
I was wondering if anyone has used a microcontroller (preferably PIC) to control multiple PWMs which are used to control 4 heating elements. I would like to do this with as few chips as possible, hopefully 1 PIC. The project requires that each heater be monitored and controlled separately. Any ideas would be greatly appreciated.
 
Replies continue below

Recommended for you

If you are referring to using the actual PWM peripheral of a given PIC product, then you will be limited. If, instead, you use a timer interrupt and handle each PWM output individually within the ISR (for example), you should be able to have as many PWM channels as you have available I/O. In other words, a project like this is up to the programmer and what you are asking should be fairly straight forward. As far as monitoring each channel, any given PIC will have one A/D converter shared by several different I/O pins, so all you would need is essentially 8 I/O, four for PWM output and four for A/D input.
 
I always found the PICs PWM services to be too limited for every application I ever needed PWM on, so I did what sdmays suggested with good effect.
 
I've done 3 pwm's with a dspic. I think you can use some of the 18 series. Look at the motor contol apps.
Bit banging will let you get away with a cheaper Pic.
 
Thanks for the help. Good suggestions. My other issue for this same project is I want to constantly measure the temperature of a device so I can control the final temperature. Currently, I use the PIC to turn on the 48V heat circuit for a small amount of time, then switch to a 5V measuring circuit for the PIC to calculate the temp and pulse width needed to keep the element at a constant temp. Also, be able to do this while controlling another element simultaneously. Thanks in advance for any ideas.
 
I've done the same on 7 channel hot melt glue gun systems too. Using the even low-lee-yer PIC16C5X. gag.

You must remember temperature is really a pretty slow process... Your sensors can't even tell anything has happened for a few seconds... And as you know a micro can do a whole lot of things in a single second.
 
I believe the time issue is where I'm having the problem. The heating element is smaller than a dime. It also heats up to 170 C in about 100ms. This is where my problem lies. I don't know if I can switch between heaters fast enough to regulate the temperature without burning up the element. Thanks for all your help. I may just have to find some cheap, tiny micros to control each element separately and then the main pic for program control and minor monitoring.
 
If your temperature sensor has a rapid enough response time, there's no reason why it shouldn't be doable.
The response time of the system can be at about a tenth of the inertia. So say 10mS per I/O update. See how much can be done with a given micro within 10mS.
 
eetrit; the big question is how are you measuring the temp? Since temp sensors are relatively S L O W? You might be better off monitoring the resistance change of your heater element because this would change with no lag between its temp and its resistance change... If it changes resistance enough.

Also I have never heard of any application that monitors the heating element! Normally no one cares about the element, they are trying to heat a space or an object up, not the element. This means they are trying to monitor the temperature of the object which itself needs time to absorb the energy and actually heat up. Again meaning what's the *big* rush.
 
How you measure the temp is the big thing here...

In 100ms, a PIC running on a 20MHz crystal will be able to process 500,000 instructions. The trick is, getting an A/D converter that will give you the response time you need, assuming that's the method you're going for. The A/D on the PIC will be in the range of ms/sample/channel, and that may not be fast enough if the element can change 1400 degrees/s.


Dan
Owner
 
I shoudl also add, if you're willing to add in some sort of open loop control (estimate the average temp increase for a specific PWM cycle), it may work out wihtout the need to constantly monitor. In other words, turn it on full blast for 10ms to heat it up, then drop back to a 35% duty cycle for 30ms (which you know form past experiments that will bring it to within 10-15 degrees of your set point.

Every so often, bump up the duty cycle a few percent, continually checking the temp. If it's too hot, bump it down a few percent. Do this over a long period, say 500ms. In other words, find a comfortable set point, and make slow changes over long periods of time...

Dan
Owner
 
macgyvers2000 correct in that if you are actually, truly, monitoring the temp of the element only because it bizarly fast the best way would be thru some sort of dead reconing derived from testing, meanwhile really controlling to the environment you are heating.
 
Thanks for all the help. Great Ideas all around. We are probably going to have to use multiple controllers in order to accomplish our goal.
 
ahhh.. We used a couple of 877s to control hot melt glue gun nozzles spraying changing custom glue dot patterns onto beer cases running down a filling line at over 60MPH without a hitch. BTW a hitch equals standing in 8" of beer the moment it happens.

So do think outta the box and study your scheme before grabbing multiple CPUs. You still may have to. Then just use the sychronous ports.
 
I've run 8 PWM outputs all at different rates, 8 bit counters, and not in an ISR either. Check the piclist site, I think Scott Dialto's code is posted there, thats what I based my code on. Runs on an 877
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor