nis2311
Member level 3
- Joined
- Nov 19, 2016
- Messages
- 54
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,804
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; }
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.............
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;
}
There actually only two possible sequences, right and left rotating. The said two sequences are the same.But I can't identify these two type of sequence YBR , BRY in this mode adc value will be same as RYB mode.
Sequece CW:
A B C
0 0 1
0 1 1
0 1 0
1 1 0
1 0 0
1 0 1
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?