×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

can multiple PWMs be controlled simultaneously by one PIC?

can multiple PWMs be controlled simultaneously by one PIC?

can multiple PWMs be controlled simultaneously by one PIC?

(OP)
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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

Bit bang it... I do, and as mays said, I can handle as many outputs as there are I/O ports.

Dan
Owner
http://www.Hi-TecDesigns.com

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

(OP)
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.  

RE: can multiple PWMs be controlled simultaneously by one PIC?

I bit-bang 9 PWMs and use a bi-directional UART on a selectable channel, all on a "lowly" 16F628.  It's definitely do-able.

Dan
Owner
http://www.Hi-TecDesigns.com

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

(OP)
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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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
http://www.Hi-TecDesigns.com

RE: can multiple PWMs be controlled simultaneously by one PIC?

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
http://www.Hi-TecDesigns.com

RE: can multiple PWMs be controlled simultaneously by one PIC?

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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

(OP)
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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

  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.

RE: can multiple PWMs be controlled simultaneously by one PIC?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources