Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I need 3 phase detection help

Status
Not open for further replies.

zeykan

Newbie level 5
Newbie level 5
Joined
Dec 4, 2022
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
67
Hello friends. I need your help. I want to detect 3 phases and pay attention on LCD. phase sequence wrong, eg phase disconnected. 380v phase to phase, 220v phase to neutral. RST but not what I tried. I am attaching the schematic. controller 16f877a. e0-e1-e2 pin input. Thank you for your help. i need c code
111.gif
 

3-phase systems can fail in many ways and be tricky to diagnose.

If you mean to replicate that circuit so it appears three times, once for each phase, it will not work reliably.
There are several problems, the first is that it relies on a neutral wire which may not always be present, more importantly though, consider what happens in real life if one phase fails. If the failure is towards the source, the phase will not be missing where you measure it because any 3-phase device 'downstream' will conduct some voltage back up from the load. The exact phase of that signal is unpredictable but it could still be 120 degrees from the other two and therefore seem OK.

The more reliable way is to sense the current as well as the voltage and phase. Under most circumstances the current and/or voltage will be significantly different between phases if a fault occurs. To do that you need a current transformer on each line and something to measure voltage instead of just detecting its presence.

Brian.
 
Hi Brian.
thanks for the answer. yes, I will duplicate the sample drawing and apply it to 3 phases. I did not prefer current transformers because they take up space. One of the phases is stationary and the other two are S-T phases, displacement detection is more than enough for me. I'm thinking of taking precautions by closing the ports that I gave other functions during the phase break. kind of like insurance. If the phase break function is activated after the phase sequence accuracy step on the LCD is passed, I will close the ports.
 

If Phase displacement is enough, it should work as you describe it. You can simplify the input circuit to one resistor and a diode 'anti-parallel' to the LED in the opto-coupler. At the expense of a little more dissipation in the resistor it will give a more precise zero crossing detection.

I would suggest you wire the 'reference' phase to the interrupt input to get fastest response and use it to reset two timers. As the other inputs change state you can read the timers to see the delay and hence phase difference.

Brian.
 

I understand, can you share sample code with me? with sample schema
 

I don't really have time to write code for you, I'm having enough trouble with the project I'm working on already!

Basically, remove the bridge rectifier and wire a single diode (a small silicon diode like the 1N914/1N4148 will do) across the LED side of the optocoupler with it pointing the opposite way around to the LED. It will conduct on the half AC cycles that the LED doesn't and so protect it from too much reverse voltage.

Connect the output of one of the optocouplers to the RB0/INT pin. This is your reference phase.
Set up a timer (suggest TMR1) to count internal clock cycles.
Write a simple ISR and enable the INT interrupt.
Inside the ISR all you do is reset the timer to zero.
Next, monitor whichever pins you have connected the other optocouplers to.
When they change state, read the timer, it will give you the number of counts since the reference phase changed and from that you can calculate the time between the inputs and therefore the phase difference.

Tricker to code but slightly more accurate is connect all the phases to PORTB and then use the interrupt on change feature but you then have to work out which pin changed as all inputs will trigger the ISR.

Brian.
 
when you remove the bridge diodes won't it be exposed to high voltage? Does opto-isolator alone provide safe isolation? What are you talking about, entering 5v pins with a zener diode and counting the timer 6.66 inside and finding the phase sequence? I know there is a 6.66 ms delay between phase degrees
 

if
portb0==0 && portb1==1 &&portb2==0 delay=6.66ms
portb0==0 && portb1==0 &&portb2==1 output pin b3 high,output pin b4 low //phase shift correct
else
output pin b3 low,output pin b4 high// phase sequence is wrong? I did not understand.
 
Last edited:

You misunderstand. Keep the opto isolator to give protection from high voltages but on the input (LED) side all you need is a resistor to limit the current and one diode across the LED to protect from reverse voltage. The LED itself will limit the voltage across it to about 1.5V as it conducts and in the other direction the parallel diode will conduct and limit the voltage to about 0.7V. The remainder of the voltage is dropped by the resistor.

The problem with the bridge solution you used it it drops more voltage across the diodes and makes the zero crossing harder to find. The optocoupler LED needs about 1.5V across it and in a bridge there are always two diodes in conduction, dropping about 0.7V each. That means the output of the optocoupler may not change until the AC has reached about 2.9V. Using the parallel diode method it is only 1.5V.

In post #8 you are correct. With any three phase system you can only look at the state of two phases relative to the third, you have to pick one of them (any of them) and call it your reference. You can then check the timing of the other two relative to the reference to see if they are in the correct order. Yes, you can just see if their logic states are as expected but without too much extra coding you can measure the delay between the signals using a timer. What you can NOT check by just looking at the logic levels is whether the phases are exactly 120 degrees apart because an open circuit line may still have voltage on it from the load and it is only voltage you are detecting. If you measure the delay between inputs changing logic states you can improve reliability because a 'reflected' signal from a load is likely to have some additional phase difference.

By 'reflected' I mean a voltage originating at the load instead of the source. Consider a three-phase motor or transformer that loses one phase because of a broken feed cable. If you measure at the source side of the break you should see the phases as expected but if you measure at the load side of the break there will still be voltage on all the phase wires because they are linked through the load windings.

Brian.
 

    zeykan

    Points: 2
    Helpful Answer Positive Rating
then 1n4148 diode in front of a 1000k 2 watt resistor to the output of the source. bridge diode cancel. 1n4148 to opto input. then we will accept phase 1 as reference and follow the signals coming with 6.66 ms as phase2 and phase3. If the 2nd opto does not send signals before 3, we will assume the order is wrong.
 

Phase checking is correct but the diode connection is wrong.

The 1N4148 (or any small silicon diode) is wired across the optocoupler LED. Connect its cathode to pin 1 of the optocoupler and anode to pin 2 of the optocoupler. Effectively you have two diodes in parallel but conducting with opposite polarities so one polarity lights the LED and the other polarity conducts through the new diode. That configuration ensures the optocoupler input is always clamped to a low voltage.

Brian.
 

    zeykan

    Points: 2
    Helpful Answer Positive Rating
That is correct.
The power dissipated in the resistor is higher but the optocoupler is more sensitive to line voltage when wired that way. It also uses fewer components!

Brian.
 
This is the current oscilloscope display. A 60k resistor is connected to the phase output. I put a 10k resistor in front of +5v on pin 5. setup_adc_ports(no_analogs) was defined because I was using other pins. below set_adc_channel(an5_an6_an7); // I tried to read e pins analog. setup_timer_t1 disabled. setup_timer_t2 disabled 0.1 set_tris_e(0b111); but I couldn't do the job of giving reference and printing the variables to the lcd :(
IMG_20221206_081015.jpg

--- Updated ---

The processor has 10 triacs and bluetooth control. my pins are limited and the number of functions I'm trying to do is high. That's why I couldn't get out of it.
--- Updated ---

I'm just wondering. Can I adjust the current between 1a and 25a by modifying the same mechanism? What I want to do is that the engines don't start when they see more than the weight I set. The amperage setting will be needed for the load limit. adjustable with pot
 
Last edited:

Or should we do this. Let's enter the pin that we will specify as a reference to e0. Let's add 6.66 ms delay and observe e1. The only way that can give a logic 1 after the reference is the correct second phase. Can we say that there is no need to consider the other phase?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top