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.

Calculating Max deviation in C

Status
Not open for further replies.

ajit_nayak87

Member level 5
Joined
Oct 30, 2017
Messages
86
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
981

I have implimented code considering the example. But in the example it not mentioned in which 2 phase unbalance has occurred.
can someone guide me here.

Code:
unsigned int Max_Current=0;
unsigned int Min_Current=0;
unsigned int Unbalance_limit=10;
unsigned int Max_Deviation=0;
unsigned int Percentage_Unblance=0;



void Unbalance_Check()

{

Imean_Current=(Rph_Current+Yph_Current+Bph_Current)/3;

if((Rph_Current>Yph_Current)&&(Rph_Current>Bph_Current))
{
Max_Current=Rph_Current;

}else if((Yph_Current>Rph_Current)&&(Yph_Current>Bph_Current))
{
Max_Current=Yph_Current;

}else if((Bph_Current>Rph_Current)&&(Bph_Current>Yph_Current))
{
Max_Current=Bph_Current;

}else if((Yph_Current<Rph_Current)&&(Yph_Current<Bph_Current))
{
Min_Current=Yph_Current; 

}else if((Rph_Current<Yph_Current)&&(Rph_Current<Bph_Current))
{
Min_Current=Rph_Current; 
} 

else if((Bph_Current<Yph_Current)&&(Bph_Current<Rph_Current))
{
Min_Current=Bph_Current; 
}

Max_Deviation=Max_Current-Min_Current;

Percentage_Unblance=(int)((Max_Deviation/Imean_Current)*100);

if(Percentage_Unblance>Unbalance_limit)
{
CRUnblance_Flag=1;
}else
{
CRUnblance_Flag=0; 
}





}
https://www.schneider-electric.co.in/en/faqs/FA300885/
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top