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.

PI Controller DC-DC Buck Converter with PIC16F877A

Status
Not open for further replies.

Eshnur

Newbie level 3
Newbie level 3
Joined
May 5, 2019
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
38
Hi. How can i add PI Controller on this circuit? btw this circuit works on ISIS but its doesn't work in real life :( could you help me?
https://imgur.com/n1MAmAf this is circuit
and codes

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
void main()
{
   set_tris_a(0xFF);     
   set_tris_c(0x01);    
  
   setup_timer_2(T2_DIV_BY_1,255,1);
   setup_CCP1(CCP_PWM);
   
   int buton_1,buton_2,buton_3,buton_4;  
   int16 Duty=0;
   float YuzdeDuty;
   set_pwm1_duty(Duty);
   
   while(TRUE)
   {  
   
     buton_1=input(pin_A0);
     buton_2=input(pin_A1);
     buton_3=input(pin_A2); 
     buton_4=input(pin_A3); 
     
     if(buton_1 == 1 && buton_2 == 0 && buton_3 == 0 && buton_4 == 0) 
     { 
     delay_ms(20);
     Duty=250;
  //   YuzdeDuty=25;
     set_pwm1_duty(Duty);
    // output_d(YuzdeDuty);
     } 
     
     else if(buton_2 == 1 && buton_1 == 0 && buton_3 == 0 && buton_4 == 0)
     { 
     delay_ms(20);
     Duty=400;
    // YuzdeDuty=50;
     set_pwm1_duty(Duty);
     //output_d(YuzdeDuty);
     } 
     
     else if(buton_3 == 1 && buton_1 == 0 && buton_2 == 0 && buton_4 == 0)
     { 
     delay_ms(20);
     Duty=600;
     //YuzdeDuty=75;
     set_pwm1_duty(Duty);
     //output_d(YuzdeDuty);
     }
     
     else if(buton_4 == 1 && buton_1 == 0 && buton_2 == 0 && buton_3 == 0)
     { 
     delay_ms(20);
     Duty=850;
     //YuzdeDuty=100;
     set_pwm1_duty(Duty);
     //output_d(YuzdeDuty);
     } 
   }
 
}

 

Attachments

  • adsız33.png
    adsız33.png
    97.3 KB · Views: 175
Last edited by a moderator:

Hi,

Should you not be using a MOSFET driver where you are using the 3904 transistor?
 

Hi,

C1, C2 value is not useful.

Please check not to overdrive V_gs of the Mosfet.

Why don't you use low side switching? (More simple)

"Doesn't work" is no useful error description. Please tell us what not is like expected.

Klaus
 

"C1, C2 value is not useful." is 22pF suitable?
"Please check not to overdrive V_gs of the Mosfet." should i add 12v battery between G and S
Why don't you use low side switching? (More simple)" because i have to use high side as i know, can i make low side driver buck converter?
""Doesn't work" is no useful error description. Please tell us what not is like expected." i will give more knowledge after i test with osilascope
 

i don't understand could you explain please?
 

Without adequate inductance in the power stage the converter will not work. In your schematic there is no inductance at all.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top