Dimmer


Closed Thread
Results 1 to 40 of 68

Thread: Dimmer

Hybrid View

  1. #1
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Unhappy

    This is the osciloscope measures from the GP4 (AcLine input), and from GP2 (Output to TRIAC).
    I use tranformer 8Vac, R3=4k7 and R4=10k.

    Look the pictures from 0 to 4. Is from value off to on through 3 steps.


    But the lamp still flashing...
    Attached Images Attached Images      

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default This doesn't look right.....

    Reven,
    I've not used that circuit or code you are reffering to but by just looking at your waveforms it seems that the triac is triggered at the same phase angle in case 1, 2, 3 & 4.

    The triac only needs a short pulse on the gate and will then hold itself 'on' untill the AC-line crosses zero, at which point it will turn 'off'. That short pulse should be delayed a certain amount of time from the zero crossing.

    On your scope pics the triac seems to be triggered exactly 1div from the zero crossing in all cases except full on and full off.

    /Henrik Olsson.

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


    Did you find this post helpful? Yes | No

    Wink Pulse position, not pulse length !!!

    Hi, reven

    Henrik is right ...

    Here, the pulse length is not the thing to be variable.

    but you must vary the time between zero voltage detection and triac gate firing ...

    Long time = weak light
    short time = full light

    remember once the triac is turned on it stays turned ON until current becomes null.


    Alain

    Here, you had programmed a ... DC Dimmer !!!
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Thumbs up Pulse position, not pulse length...

    I think you have right...
    As Henrik says ,now the triac is triggered at the same phase angle in all cases.
    I must change my code to put the pulse position in a variable.
    Thanks all of you!
    I will inform you about my progress!




    BTW, take a look at the code,bacause I checked it many times and I could not find where the problem is.

    http://www.picbasic.co.uk/forum/atta...0&d=1103787743

    Thanks again,
    Reven

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Got it !!!

    Hi, Reven

    Just understand what the interrupt routine does instead of should have done ...

    ""
    ' ACDetect
    ' --------
    '
    ' Interrupt routine called by ACLine (GP4) pin state change
    '
    disable
    ACDetect:
    if ACline==1 then ' Check for rising edge of AC signal
    if triacdelay > 0 then
    Triac=1 ' Activate TRIAC

    Alain's : ;;; No,No,No ... here we have to wait for ( Maxdelay - Triacdelay ) !!! THEN fire the Triac for, say, 20µs ... then let things quiet.

    if FullBright==0 then ' In case Brightness flag is not set
    pauseus triacdelay ' do the selected delay
    triac=0 ' Disable TRIAC
    endif
    else
    triac=0
    endif
    endif
    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable

    ""


    *** This part of program smells to have been taken from a heather using burst mode dimming ...

    Sorry, Steve ... je t'aimais bien ( avec la musique de circonstance ... )

    Alain
    Last edited by Acetronics2; - 13th December 2005 at 12:15.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, sorry all. something should be wrong in what i posted. I used that program in various app and it worked... let me the time to return at home(Next week) and i'll compare the posted version and what i use...

    Many thousands of appologies.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Can't wait to return home... use the following ACDetect routine instead.
    this should work.
    Code:
    disable
    ACDetect:
    if ACline==1 then 
        '
        '    Rising edge of AC signal
        '    ========================
    	if triacdelay then              ' A delay is set by user
                                            '  
    	    if FullBright==0 then       ' Full Brightness flag is not set
                pauseus maxdelay-triacdelay '    do the selected delay
                triac=1                     '    enable TRIAC	    	
                else                        '
        	        triac=1                 ' Full Brightness flag is set
                                            '    enable triac
                endif                       '
                                            '
            else                            '
        	    triac=0                     ' No Delay set by user... disable Triac
            endif                           '
        
        else                                
        '
        '    Falling edge of AC signal
        '    =========================
            if fullbright==0 then triac=0   ' Disable the Triac on falling edge of 
                                            ' Ac signal
        endif
    INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
    resume
    enable
    Yeah i know you can also use Pulsout and forget the Falling edge detection... as you wish. Both will work.
    Last edited by mister_e; - 18th December 2005 at 11:39.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PICDIM Lamp Dimmer for the PIC12C508 - PICREF-4
    By charudatt in forum General
    Replies: 8
    Last Post: - 2nd September 2015, 07:14
  2. Dimmer switch
    By iugmoh in forum Off Topic
    Replies: 4
    Last Post: - 20th March 2009, 16:02
  3. Ideas on ir-code for dimmer
    By tirithen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th February 2009, 23:22
  4. 50hz sync for light dimmer
    By tirithen in forum General
    Replies: 2
    Last Post: - 6th September 2008, 19:29
  5. Dimmer Circuit
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 25th January 2007, 14:37

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