قسم الميكروكنترولر والروبوت ودوائر الاتصال بالحاسب الالي قسم المتحكمات الـ microcontroller و المعالجات microprocessor و التحكم الرقمي بالكمبيوتر CNC والانظمة الآلية والروبوت Robots

أدوات الموضوع

ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 02-12-2012, 08:11 AM المشاركة 1   
افتراضي مشكلة في مشروع جاهز لخبراء ال pic c compiler تنظيم معامل القدرة Twitter FaceBook Google+



مشروع جاهز تنظيم معامل القدرة لكن هنالك مشكلة في الكود ...
يتبين من التقرير المرفق ان الكود على pic18f877a ولا يوجد ميكروكنترولر بهذا الاسم ...
الرجاء المساعدة ...
Power Factor Controller


6.1 Introduction :
It is important to take into account the importance of power Factor loads in it which can be reduced the current of the load, so, reduction the power losses and it important to reduce the amount of electricity from the network. Then that cause reduction of the pill and this is what we're aiming for in the project
Definition:
Power factor (p.f) is the ratio between actual power to apparent power .
P.F = KW/KVA .
For a purely resistive load the power factor is unity . active and reactive power are designated by P&Q respectively . The average power in a circuit is called active power and the power that supplies the stored energy in reactive elements is called reactive power .
Needs of power factor controller

Power factor correction (PFC) is a technique of counteracting the undesirable effects of electric loads that create a power factor that is less than one. Power factor correction may be applied either by an electrical power transmission utility to improve the stability and efficiency of the transmission network or correction may be installed by individual electrical customers to reduce the costs charged to them by their electricity supplier.




Measure power factor:
Power factor is an important measurement for two main reasons. First, an overall power factor of less than 1 means that an electricity supplier has to provide more generating capacity than actually is required.
Secondly, the current waveform distortion that contributes to reduced power factor is a cause of voltage waveform distortion and overheating in the neutral cables of three-phase systems
KVAH = (〖KWh〗^2+〖KVARh〗^2 )
Average power factor over month
P.F = KWh/KVAh
Case of low power factor :
A poor power factor can be the result of either significant phase different between the voltage and current at the load terminals or it can be due to a high harmonic content or discontinuous current waveform . Poor load current phase angle is generally the result of poor load current phase angle is generally the result of an inductive load such as an induction motor , power transformer , lighting ballasts , welder or induction furnace , induction generators , wind mill generators and high intensity discharge lightings .
A distorted current waveform can be the result of a rectifier variable speed drive , switched mode power supply discharge lighting or other electronic load .

Disadvantage of low power factor:
Increase heating losses in the transformers and distribution equipments.
Reduce plant life
Unstabilise voltage levels
Increase power losses
Upgrade costly equipments
Decrease energy efficiency.
Increase electricity costs by paying power factor surcharges

Most load on an electrical distribution system fall into one of three categories ; resistive , inductive or capacitive . In most common is likely to be inductive . Typical examples of this include transformers , fluorescent lighting and conductive coil winding to produce an electromagnetic field , allowing the motor to function
All inductive loads require two kinds of power to operate :
Active power (KW) – to produce the motive force
Reactive power(KVAR) – to energize the magnetic field
The operating power from the distribution system is composed of both active (working) and reactive (non-working) elements . The active power does useful work in driving the motor whereas the reactive power only provides the magnetic field .
The amount of power Capacitor KVAR required to correct a system to a desired power factor level is :
Qc = P (tan old – tan new)

The most efficient location for power factor capacitor at the load . Capacitors work from the point of installation back to the generating source . Individual motor correction is not always practical , sometimes it is more practical to connect larger capacitors on the distribution bus or install an automatic system at the incoming service along with fixed capacitors at the load .

Advantage of power factor correction:
Eliminate power factor penalties.
Increase system capacity .
Reduce line losses in distribution systems .
Conserve energy .
Improve voltage stability .
Increase equipment life .
Save on utility cost .
Enhance equipment operation by improving voltage .
Improve energy efficiency .
Reduction in size of transformers , cables and switchgear in new installations .
Delay costly upgrades .
Less total plant KVR for the same KW working power .
Improve voltage regulation due to reduced line voltage drop .




6.2 Part of project :
The project divide for two type : hardware and software, let's begin of description on hardware , the project consist from main part :
current transformer : to step down the phase current , in the project we consider the current input as voltage wave form through resistor 6.8 ohm .
voltage transformer : to step down the phase voltage ,we use 220v/6v transformer .
circuit to change the phase shift consist from inductor and variable resistor , design it on current measurement due to make the power factor lagging , because the load always have lagging power factor .
PIC Controller : we use PIC 18F877A due to :
Simplicity .
Easy to use .
Cheap .
More common .
Relays : to control of the capacitor bank by switching on and off ,that's controlled from PIC
Hyper terminal : to see the result on the computer screen






6.3 Block diagram :









The photo of hardware :






How to measure the phase shift ?
We can see from the photo below , that the voltage and current wave divided to many sample , the program work as :
Read the first sample from the voltage waveform and Compares them with earlier old if it greater take it , if not take the next sample , then the taken sample compare with the next sample if less read the next sample if not then this sample is the max sample ,save it as maximum value of voltage and start timer .
Same thing to current , when reach the maximum value of current take the sample and stop timer .
So, the time measured which can be calculated the power factor , and from the sample we can also calculate the value of input current and voltage .


The performance of program :
After calculated the current , voltage and phase shift . the value of Qc added depend them , but this not the end of program , the load is changing , then we need to add another capacitor if the power factor less than 0.92 or separated capacitor if the power factor greater than 0.96 .how we do that?
We want to save the value of the capacitor on the output pin of PIC , and we check the power factor every 30 minutes then chick if the power factor decrease add the smallest capacitor then calculate P.F if still less 0.92 , add another capacitor gradually until the P.F reach 0.95 , the value of capacitor can written on the output pin of PIC as 4 bit binary
First bit : 50 VAR
Second bit : 100 VAR
Third bit : 200 VAR
Forth bit : 400 VAR
Then the principle become easy as if the power factor decrease add (0001) to the save capacitor . And if the power factor increase mines (0001)

6.6 The code:

كود:
#include "D:\project's\picc \code00.h"


void main()
{
 int x=0;
 int y=0;     // input arrangments
 int z=0;
int count0=0;

long G1=0;
long V1=0;
long I1=0;

float G=0.0;
float V=0.0;
float I=0.0;

   setup_adc_ports(AN0_AN1_AN3);
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);


printf(" Wellcome To My Software \n");
restart_wdt();
                                              // TODO: USER CODE!!
 while(true){
 if(!input(pin_B0)){
 x=1;
 printf("The G value : ");
 printf("\n");
 }
 else x=0;
//---------------------------------------
if(!input(pin_B1)){
y=1;
printf("The V and I points :");
printf("\n");
}
 else y=0;
//---------------------------------------
if(!input(pin_B2)){
printf("END");
printf("\n");
reset_cpu();
}

//   ----------------- code for G.value ------------------

if(x==1){
set_adc_channel(0);
delay_ms(10);
G1=read_adc();
delay_us(100);
G=(float)(G1*5)/1023;
delay_ms(10);
G=G/0.00459;
printf("G = %f " G);
printf("\n");
x=0;
z=1;
}
 else x=0;
 //--------------------------- end G. code ---------------

 //------------------- V,I points code -------------------

 while(y==1&&z==1){
 set_adc_channel(1);
 delay_ms(10);
 V1=read_adc();
 delay_us(100);
 V=(float)(V1*5)/1023;
  time = set_timer0();
 delay_us(10);
 printf(" V %d = %f " count0,V);
 printf("\n");
 delay_us(100);

restart_wdt();

 set_adc_channel(3);
 delay_ms(10);
 I1=read_adc();
 delay_us(100);
 I=(float)(I1*5)/1023;
  time = get_timer0();
 delay_us(10);
 printf(" I %d = %f " count0,I);
 printf("\n");
 delay_us(100);

 if(!input(pin_B2)){
 y=0;
 z=0;
 printf("END");
 }
 }
 p.f=((360*time)/6.28);
 printf("%f".p.f);

 p=Vi*Ii*cos(p.f);
 Q=Vi*Ii*sin(p.f);

 Qc=P(tan(time)-0.3278));

 if(Qc<=100){
 output_b(0x00);
}
else if(Qc<150){
 output_b(0x02);
 }
else if(Qc<200){
 output_b(0x03);
 }
else if(Qc<250){
 output_b(0x04);
 }
else if(Qc<300){
 output_b(0x04);
 }
else if(Qc<350){
 output_b(0x06);
 }
else if(Qc<4000){
 output_b(0x07);
 }
else if(Qc<450){
 output_b(0x08);
 }
else if(Qc<500){
 output_b(0x09);
 }
else if(Qc<550){
 output_b(0x0a);
 }
else if(Qc<6000){
 output_b(0x0b);
 }

qin =Qc;

if(p.f<0.92){
#add Qc,1;
}
if(p.f>0.96){
#sub Qc,1;
}
Inw=((squre(P^2+(Q-Qc)^2))/Vi);
printf("%f",Inw);
p.fn=(P/(Q-Qc));
printf("%f",p.fn);
restart_wdt();

 t---------------- END calculation  code ---------------
restart_wdt();
 }
}
http://www.electvillage.com/upload//...ile=646a746175
http://www.electvillage.com/upload//...ile=e1e78ab818
http://www.electvillage.com/upload//...ile=796f9adceb

اعلانات

ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 02-12-2012, 01:25 PM المشاركة 2   
افتراضي


http://www.4shared.com/file/qXmrGjCQ...Word_Docu.html

اعلانات اضافية ( قم بتسجيل الدخول لاخفائها )
  

ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 03-12-2012, 07:59 AM المشاركة 3   
افتراضي


وين الردود يا اخوان ....


mtus
:: مهندس ::
تاريخ التسجيل: Apr 2009
المشاركات: 12
نشاط [ mtus ]
قوة السمعة:0
قديم 03-12-2012, 01:28 PM المشاركة 4   
افتراضي


السلام عليكم

أخي ممكن توضح ماهي المشكلة لديك هل هي في البيك ام في الكود المرفق . بالنسبة للنوع اكيد pic18f877a مش موجود لكن اضن انهم يقصدوو pic16f877 لانه الاكتر شيوعا واستخداما على نطاق واسع ممكن خطاء مطبعى والله اعلم
موفق يا اخي


ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 03-12-2012, 04:54 PM المشاركة 5   
افتراضي


السلام عليكم

أخي ممكن توضح ماهي المشكلة لديك هل هي في البيك ام في الكود المرفق . بالنسبة للنوع اكيد pic18f877a مش موجود لكن اضن انهم يقصدوو pic16f877 لانه الاكتر شيوعا واستخداما على نطاق واسع ممكن خطاء مطبعى والله اعلم
موفق يا اخي
و عليكم السلام شكرا على اهتمامك اولا
المشكله في الكود انه حتى لو طبقته على pic 16f877a برضو مش شغال و بكون فيه كثير اخطاء و الغريب في الموضوع انه لازم يكون شغال100% حاولة اصحح في الاخطاء برضو ما اشتغل
حاول تطبقه حيعطيك 30 خطأ ..
و شكرا مره اخرى...


mtus
:: مهندس ::
تاريخ التسجيل: Apr 2009
المشاركات: 12
نشاط [ mtus ]
قوة السمعة:0
قديم 03-12-2012, 06:45 PM المشاركة 6   
افتراضي


السلام عليكم اخي الكريم

أطن ان مشكلتك تكمن في الهيدر فايل للمكتبة include#
#include "D:\project's\picc \code00.h" اما ان يكون المسار غير صحيح او ان الملف غير موجود جرب ان تتأكد من وجود الملف Code00.h بنفسك او قم بتعدليل المسار اتمنى ان انفعك بمشاركتي موفق بأدن الله اخي العزيز


ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 03-12-2012, 07:40 PM المشاركة 7   
افتراضي


السلام عليكم اخي الكريم

أطن ان مشكلتك تكمن في الهيدر فايل للمكتبة include#
#include "D:\project's\picc \code00.h" اما ان يكون المسار غير صحيح او ان الملف غير موجود جرب ان تتأكد من وجود الملف Code00.h بنفسك او قم بتعدليل المسار اتمنى ان انفعك بمشاركتي موفق بأدن الله اخي العزيز
و عليكم السلام و رحم الله و بركاته ..
اخي المشكله مش بالهيدر لاني سابقا عملت بروجكت جديد بالمواصفات اللازمه و نسخت الكود مع الاحتفاظ بالهيدر الجديد
بعد ذلك تظهر المشاكل
اذا عندك الرنامج جرب يمكن تكتشف المشكله
و شكرا..


ali jaradat2008
:: مهندس ::
تاريخ التسجيل: Oct 2012
الدولة: فلسطسن
المشاركات: 16
نشاط [ ali jaradat2008 ]
قوة السمعة:0
قديم 08-12-2012, 11:23 AM المشاركة 8   
افتراضي


يا ريت المساعدة يا اخوان ....

إضافة رد

العلامات المرجعية

«     الموضوع السابق       الموضوع التالي    »
أدوات الموضوع

الانتقال السريع إلى


الساعة معتمدة بتوقيت جرينتش +3 الساعة الآن: 10:19 AM
موقع القرية الالكترونية غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي موقع القرية الالكترونية ولايتحمل الموقع أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)

Powered by vBulletin® Version 3.8.6, Copyright ©2000 - 2025