Time Proportional Control Example?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Time Proportional Control Example?

    Time Proportional Control is pretty much a slower version of PWM where the duty cycle is varied by on and off time. For example, if the time span is 10 seconds and I want 90% on time then, that converts to 9 seconds on and 1 second off.

    So, the output of the PID routine would span between 0 and 10 seconds for on vs. off time. To accomplish this, I need a way to make a guess as to whether the SSR should be on or off based on the output of the PID loop.

    See this link, this link, and this link for the Arduino example.

    Thanks for the help,
    Curtis

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: Time Proportional Control Example?

    Hello Curtis

    Welcome to the forum.

    Your problem can be broken down into 2 parts
    1 - caluclate the value of output power via your PI routine
    2 - convert this power to a time value

    From your question, I guess, you have no issues with point 1

    Assume you have power going from 0 to 100% corresponding from full off to full on. This can be converted to time thus

    If the cycle time Tcyc you specified for your controller is - let us say - 10 seconds

    On time will be
    Ton = (Tcyc * Power) / 100

    With this, you will get a Ton ranging from 0 - 10 seconds

    Now, to control the duty cycle of your heater using this value, you can do this
    Tvar var word

    Tvar is a variable that runs from 0 to 10 seconds.


    Tvar = Tvar + 1
    if Tvar >= 10 then Tvar = 0 ' roll over

    if Tvar < Ton then
    gosub HeaterOn
    else
    gosub HeaterOff
    endif

    I hope this will help you


    Oh, I forgot to add that you need to have the code above run at a fixed 1 second rate to get correct results
    Last edited by Jerson; - 2nd May 2011 at 05:14. Reason: added

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Time Proportional Control Example?

    Quote Originally Posted by Jerson View Post
    Hello Curtis

    Welcome to the forum.

    Your problem can be broken down into 2 parts
    1 - caluclate the value of output power via your PI routine
    2 - convert this power to a time value

    From your question, I guess, you have no issues with point 1

    Assume you have power going from 0 to 100% corresponding from full off to full on. This can be converted to time thus

    If the cycle time Tcyc you specified for your controller is - let us say - 10 seconds

    On time will be
    Ton = (Tcyc * Power) / 100

    With this, you will get a Ton ranging from 0 - 10 seconds

    Now, to control the duty cycle of your heater using this value, you can do this
    Tvar var word

    Tvar is a variable that runs from 0 to 10 seconds.


    Tvar = Tvar + 1
    if Tvar >= 10 then Tvar = 0 ' roll over

    if Tvar < Ton then
    gosub HeaterOn
    else
    gosub HeaterOff
    endif

    I hope this will help you


    Oh, I forgot to add that you need to have the code above run at a fixed 1 second rate to get correct results
    Very good! You made it look so simple. I'll be sure to post the code once it is all worked out.

    Thanks,
    Curtis

  4. #4
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Time Proportional Control Example?

    Yup, as I said, my lack of understanding. Thank you for the links Curtis. It may just be time for me to start playing with PID. Good luck with your project
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts