3 phase sequencing


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    This code wasn't interrupt-driven, because it didn't need to be
    By changing "PhaseDelay" you can make it work for either 60 or
    400 hz, or by using PULSIN, you can make it auto-sensing.




    CheckACPhase:
    HighTimer = 0
    CheckPhaseA:
    IF PhaseA = 0 THEN ' Voltage is present or else wouln't be low
    WHILE PHASEA = 0:WEND
    HighTimer = 0
    GOTO CheckPhaseB
    ENDIF
    Pauseus PhaseDelay
    HighTimer = HighTimer + 1
    IF HighTimer => 10 THEN GOTO PhaseAError
    GOTO CheckPhaseA
    PhaseAError: ; No phase A - was never low in 930 uSec period
    StatINfo.0 = 0 ; Can't check for proper phasing, so give error
    HighTimer = 0
    CheckPhaseB:
    If PhaseB = 0 THEN
    StatInfo.3 = 0 'Erase the error
    HighTimer = 0
    Goto CheckPhaseC
    ENDIF
    WaitForLowB:
    Pauseus PhaseDelay
    IF PhaseB = 0 THEN goto PhaseBError2
    HighTimer = HighTimer + 1
    IF HighTimer => 10 THEN GOTO PhaseBError1
    GOTO WaitForLowB
    PhaseBError1: ; No signal
    StatINfo.1 = 0 ; Can't check for proper phasing, so give error
    HighTimer = 0
    GOTO CheckPhaseC
    PhaseBError2: ; Signal, but wrong phase

    HighTimer = 0
    CheckPhaseC:
    If PhaseC = 0 THEN
    Goto DunPhaseCheck
    ENDIF
    Pauseus PhaseDelay
    HighTimer = HighTimer + 1
    IF HighTimer => 10 THEN GOTO PhaseCError
    GOTO CheckPhaseC
    PhaseCError:
    StatInfo.2 = 0

    DunPhaseCheck:
    IF Statinfo.0 = 0 or StatInfo.1 = 0 OR Statinfo.2 = 0 Then
    StatInfo.3 = 1
    ENDIF
    RETURN



    ; When returned, Statinfo bit 3 = 0 = OUT OF PHASE
    ; bit 0 = 0 = PhaseA not present
    ; bit 1 = 0 = PhaseB not present
    ; bit 2 = 0 = PhaseC not present
    ; When any phase is not present, bit 3 is always SET.
    Charles Linquist

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Wow, Charles, the whole thing on a platter!

    Thank you so much. Appreciate your sharing the code.

    Regards,

    Anand

Similar Threads

  1. 3 phase supply detector challenge
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th May 2009, 07:54
  2. 3 phase PWM with dsPIC30F2020
    By nemmard in forum mel PIC BASIC
    Replies: 1
    Last Post: - 21st January 2009, 14:19
  3. Understanding 3 phase sequencing
    By ardhuru in forum General
    Replies: 3
    Last Post: - 22nd June 2008, 10:14
  4. Someone help me to simplify this
    By thrix in forum General
    Replies: 4
    Last Post: - 21st February 2004, 05:01
  5. Help wanted..
    By thrix in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 17th February 2004, 23:44

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