HPWM min freq ?


Closed Thread
Results 1 to 14 of 14

Thread: HPWM min freq ?

  1. #1
    swordman's Avatar
    swordman Guest

    Default HPWM min freq ?

    Hi,
    Can I use hpwm 0.1 hz out for on/off kontrol?
    For example 2sec on 2sec off.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi Sword,

    NO ...there are min. frequencies ( see manual ...) but you could much better use Timer 1 for your project ...

    Alain

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Do a search for 'Slow Software PWM' or 'SSPWM' in the MeLabs archives.

  4. #4
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I need hpwm , becouse must work always in background,
    for control (PID control) temperature .

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Don't quote me, but I vaguely recall that example does run in background.

    I can see where you're going with this though... proportional switching of Thyristor/Triac Packs for Heating as an example... if that is the case, then putting in a PIC with HPWM is overkill as you can do that in a couple of hundred bytes in a 12C509... If on the other hand you're using the PWM to generate an output voltage proportional to temperature, then you really should be using a much higher frequency.

  6. #6
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I need for SSR control , like industrial temp(PID,PI,on/off) controllers.
    When reading value is near to set point , out pic pin.x (to SSR) must switching(pulses between 0.5-3 sec).
    Also when main program work, thats (temp control)application must work in background.


    Hardware: 16f877a-4mhz + LCD+5 buttons(Set &IN) + 1 ADC In (THermocouple read)
    Last edited by swordman; - 6th September 2004 at 12:00.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Question

    Hi,

    If you run a PID regulator ... there's a timebase somewhere, so, just count n cycles for 10 seconds and switch on if required ...n cycles and switch out ... etc.

    you said ON/OFF output, it seems ...not real PWM with %.

    then you can make a very simple output drive !!!

    Alain

  8. #8
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Application (Temp control)will be set : SSR out:
    1.ON/OFF
    2. PI
    3.PID

    The idea is two in one : 1.Temp cont(Like industrial) , 2.Main Program

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Question

    Where' the problem ???

    Alain

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Conventionally, PID Controls take the temperature as an input and give a proportional 0-10v as an output, which is accepted practice for all BMS.

    You then have separate heating/refridgeration controllers which accept the 0-10v proportional signal as an input and control the SSR's.

    As separate units they give you many advantages - least of which is versatility. You can have single and three phase SSR's in dozens of sizes from less than 1kW to 100's of kW, yet they'll all accept the common 0-10v proportional input.

    Seems a case of reinventing the wheel by welding the tyre to the hub as a single entity...

  11. #11
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    The problem is when main program work in background temp control(time based for pid) must work.

    For example(time based):
    Set Point = 200 C
    When adread 190C out(to SSR) must 3sec-on, 1 sec - off
    When adread 195C out(to SSR) must 2sec-on, 0.5 sec - off(aproximate)

    etc.

  12. #12
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Since the PID calculation will probably take less than 5mS why not just calculate it during one mains cycle... you've got 8mS to play with at 60Hz... and if you miss one cross-over point, simply wait for the next one 8mS later... even if you miss ten cross-overs (80mS), it's no big deal in Heating... there's probably so much Thermal Lag nobody would notice anyway.

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Angry

    As the drive calculation is a part of the PID regulator section, why do you want to switch on and off outside the background work ???

    IF you had a constant time period for switching ( 2 sec on, 2 off ; 1 sec on, 3 off ...) it would be so easier to drive ...

    I do not understand why you want so much difficulties ...

    Definitely bye !

    Alain

  14. #14
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    In main program I have many pause command, if I use
    pidout:
    high pidout ause (error*100):low pidout: (pause error*50)
    goto pidout

    the work very slow and unstable.I must use gosub adread in loops(for/next) becouse loops are 1-180min.When I use that sample (pidout) pic work unstable(slow).



    Timed out must be like this:
    ----_______-------------_______--------____-----___----__--_-____
    ~~!~~~~~~~~~~~ Error ~ ~~~~~~~~~~~~~~~~~~~~~~~!Set Point





    main:
    gosub button
    gosub adread
    high portc.2 : pause 2000
    gosub adread
    high portc.4 : pause 1000
    gosub adread
    low portc.2 : pause 2000
    gosub adread
    for x

    gosub adread
    next x
    gosub lcd: gosub lcd

    goto main

    adread:

    adcin 0,read1 : pauseus 16 : adcin 0,read2 : pauseus 16
    adcin 0,read3 : pauseus 16 : adcin 0,read4 : pauseus 16

    readt = (read1 + read2 + read3 + read4 ) / 4
    z = ( readt*40 )/130
    error = t -z
    ....... PID calculation+ PID controlled out
    return


    lcd:...........return
    loop:........return
    button:....return

    end
    Last edited by swordman; - 6th September 2004 at 14:55.

Similar Threads

  1. Maximum HPWM freq. 12F683
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th August 2008, 15:55
  2. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  3. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  4. Changing Freq of HPWM
    By Rayneobid in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 12th April 2005, 18:55
  5. HPWM on a 628 is not changing freq.
    By dtit in forum General
    Replies: 2
    Last Post: - 25th February 2005, 09:34

Members who have read this thread : 0

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

Posting Permissions

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