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.

[PIC] Pic18f452 for three phase sequence identification

Status
Not open for further replies.

nis2311

Member level 3
Member level 3
Joined
Nov 19, 2016
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,804
I am trying to find out the phases of the given supply, the project main aim to protect the three phase motor if any wrong sequence given to motor...........

I am giving three phase AC Voltage (5 volt) with different phases, let us assume R Y B to the RA0 RA1 RA2

I am taking each phase 30 samples, but I cant find it out which phase is that........ How to find the phase starting point or ending point........

My code is below ............Please check the code give me an idea to find phase sequence....................



Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
while(1)
{
for(i=0;i<=30;i++)
{
ADCON0=0x85;  ///ANO ON
adc_read();   ///reading ADC RESULT 
adc_convert(); ////ADC RESULT CONVERTING TO DECIMAL 
samples_r[i]=adc_total;
ADCON0=0x0D;   ///AN1 ON
adc_read();
adc_convert();
samples_y[i]=adc_total;
ADCON0=0x15; ////AN2 ON
adc_read();
adc_convert();
samples_b[i]=adc_total;
__delay_ms(10);
 }
for (i =0; i <=30; i++)
{
        if (largest < samples_r[i])
                largest = samples_r[i];
}//////finding largest values from samples R PHASE
adc_total=largest;
r=largest;
largest=0;
for (i =0; i <=30; i++)
{
        if (largest < samples_y[i])
                largest = samples_y[i];
}//largest for Y phase
adc_total=largest;
y=largest;
largest=0;
for (i =0; i <=30; i++)
{
        if (largest < samples_b[i])
                largest = samples_b[i];
}///largest for B PHASE
adc_total=largest;
b=largest;
largest=0;
}



displaying r,y,b..........


sometimes R is greater or Y is greater or b is greater they are Random in Amplitude...........
but I can't find the which Phase is that...........
 
Last edited by a moderator:

Hi,

Show us your schematic. Especially the three phases to the ADCs.

I'd say its much easier if you use a known, fixed sample rate instead of random timing.

Klaus
 

I am trying to find out the phases of the given supply, the project main aim to protect the three phase motor if any wrong sequence given to motor.............

There are no wrong way to connect a three phase supply to a three phase motor. There are exactly two ways.

One way the motor will run one way and the other way the motor will run the other way (reverse).

If your three phase frequency is low (less than 1kHz), you can take each phase and install a zero crossing detector. The hardware is simple enough.

Feed this three information to the PIC at three digital inputs. Rest is trivial (unless I have not understood something)
 

It's worth adding that unless you can compare timing from another source, it is impossible to tell the absolute ID of the phases when you only have three wires. You can tell their relative phase from one to another but not which is RYB (or Brown, Brown, Brown as EU have for some reason specified).

If you have a neutral wire or Earth, the easiest way is to forget the ADC and use zero crosing detectors. Pick one phase (any) as your reference and call its zero crossing 'time zero', the next phase to go through zero is the one 120 degrees behind it, the third is the remaining one. If you do not have a neutral or Earth wire, there may not be any zero crossing at all, in that case use an ADC but all you have to do is use one of the phases as your reference and as it reaches peak voltage, see if the voltage on another one is rising or falling.

Brian.
 

Hi,

Indeed you only need two phases an neutral to detect direction.

Neutral is your voltage reference.

A simple curcuit just uses two zero cross comparators and a DFF.
Each phase --> voltage divider --> comparator
One comparator output to DFF clock input
Other comparator output to DFF data input
DFF output = direction.

Klaus
 

If there is no neutral, there is unlikely to be a detectable zero crossing either. In that situation, I think the easiest way is to call one phase 'reference' and periodically sample the voltage on one of the other wires. It would be impossible to read when it crossed 'zero compared to neutral' but it would be possible to find the peak of it's cycle and use that as the timing reference. The 'real time' of the reference point is unimportant as long as you can pick a fixed place to measure at least one of the others from.

It can be done with a peak detector, comparators and D-FF but an MCU would probably be easier to implement.

Brian.
 
I believe the "with or without neutral" discussion has been brought up because the OP didn't manage to post a schematic, and also because the problem is specified incompletely.

Considering that a three-phase motor doesn't use a neutral connection, it's of course possible to examine the phase-to-phase voltages and phase sequence as seen by the motor without a neutral connection. Testers and phase sequence control relays are made with or without neutral connection, the signal used by the internal circuit looks respectively different.

Sketching the phasors clarifies how.

As for the measurement performed by the code in post #1, it's not actually determining a sequence, and it's sampling too slow to see the phase shift of voltages directly. It could still determine the phase sequence from a single sample point (or a few, depending on the performed snapshot), but it doesn't. And it can much easier by reducing the sample period to 1 or 2 ms.
 

There is no problem about the neutral or ground. The voltages in the three phases are always referred with respect to the ground.

(Just test each phase with a simple neon light voltage tester; that it works means that there is a path for the three phases to the ground)

Couple each phase with a small capacitor and use the PIC ground for reference. It cannot be simpler. Just make sure you do not apply high voltage to the PIC. Best to use an opto-coupler.
 
Last edited:

Sequences found but only Particular type Sequence
Identified Sequence:
RBY
YRB
BYR
the above sequence is identified easily and we can display Wrong Sequence
But below sequence only cant be identified
YBR
BRY

My Program is below Please give me idea to identify the sequence

Code:
while(1)
{
ADCON0=0x85;
adc_read();
adc_convert();
samples_r[0]=adc_total;
if(samples_r[0]==0)
{
samples_r[0]=adc_total;
ADCON0=0x0D;
adc_read();
adc_convert();
samples_y[0]=adc_total;
ADCON0=0x15;
adc_read();
adc_convert();
samples_b[0]=adc_total;
}

if samples_r[0]==0 means
that time R=0 ,Y=0 and B=some value (RYB MODE connection) comparing the adc values matches this sequence
using this concept we can identify RBY,YRB,BYR these sequence connected to PIC we can say WRONG SEQUENCE
But I can't identify these two type of sequence YBR , BRY in this mode adc value will be same as RYB mode

HELP ME.........................
 

I'm not sure what compiler that is written for but it certainly isn't complete and I can't understand whay the ADC clock frequency is changed between measurements.
The method doesn't seem to make sense.

nis2311 - consider this: If I gave you ONE wire and told you it had AC on it, would you be able to measure it ? If your answer is yes, please explain how you would do it.

Brian.
 

But I can't identify these two type of sequence YBR , BRY in this mode adc value will be same as RYB mode.
There actually only two possible sequences, right and left rotating. The said two sequences are the same.
 

sequence.png
Sir I attached the circuit for three phase sequence.Please find it in attachment column. Help me to solve the problem...................
 

Hi,

don´t you expect negative voltages on an AC network?

--> The PIC input voltage range is limited to GND ... VCC only. No negative votages.

Klaus
 

I have found this circuit in many Sequence Detector Device are all using. they used PIC16F micocontroller. If the sequence correct means MC gives output to RELAY circuit. Sequence Wrong means Relay is in OFF mode. What is the logic they are using.............Help Me
 

Hi,

I belive in this. But it doesn´t mean that they stick on datasheet specifications.

***
There are three inputs: A, B and C

Code:
Sequece CW:
A B C
0 0 1
0 1 1
0 1 0
1 1 0
1 0 0
1 0 1
If it is in this direction, then it is CW
If it is in opposite direction, then it is CCW

If it jumps, or you see 000, or 111 then there is something wrong.

That´s all behind the code.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top