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.

Automatic Voltage Regulator almost complete..but impossible without your help!!!

Status
Not open for further replies.

nirajd

Junior Member level 1
Junior Member level 1
Joined
Jul 12, 2013
Messages
16
Helped
3
Reputation
6
Reaction score
3
Trophy points
3
Activity points
154
hi friends..I am making an AVR(automatic voltage regulator) using pic16f877a for a lab generator!!! i have successfully written the codes in C and simulated the whole program using Proteus!!
The whole scenario of my work is as follows:
I have used two analog inputs(obtained after rectification, filter and regulation 7805) and converted both of them to digital values using the inbuilt ADC. One input acts as a reference. A continuous error is generated after subtracting the two ADC values of the inputs continuously(REF-ADC_value1)!!
The error is then passed to PID controller!! using inbuilt PWM technique, an appropriate pulse is taken as output! first of all, let's suppose the reference analog voltage is 4.5V and the analog input of the generator before excitation
is nearly 1V. At these condition, the error is positive. the code is such that the duty cycle of the output pulse is nearly 100%, that means, a continuous excitation is provided to the generator...During
this process, the terminal voltage of the generator may exceed 4.5v ie. more than the reference (error negative), in such situation, the code prompts the microcontroller to calculate the error and decrease the duty cycle of the output pulse!! That makes the excitation system to decrease!!

but the problem i encountered during practical trial is as follows:
I used a reference voltage of 220 volts ac (before rectification and all that..). when I vary the other input voltage from 190volts ac to 220 volts ac, the duty cycle of the pulse in an osciloscope is constant.
Now the main problem is when this input is varied from 220V to further upto 250Volts (ac), there is no significant decrease in the duty cycle of the output pulse.. just decrease up to three or four decimal places.. not even a whole number!!
PLEASE SUGGEST WHAT SHOULD BE DONE!!!
REGARDS,
NIRAJ!
 

First of all, why all the exclamation points????!!!!! Calm down!

You need to do some debugging. I would first look at the values you are applying to your ADC. It's not clear to me how you are converting your 220VAC to a dc value. That part about using a 7805 regulator has me confused-if you are passing your inputs through a regulator, then you will see 5 volts REGARDLESS of what the input does(assuming it's above about 7 volts); this can't be right.

Do you have an emulator for the PIC, so that you can monitor internal signals? I would first look at your error signal and verify that it changes properly with respect to your two input voltages.
 

First of all, why all the exclamation points????!!!!! Calm down!
oops! i m a bit habitual with the exclamatory mark. :) :) haha! Thanks for the reply.
That part about using a 7805 regulator has me confused-if you are passing your inputs through a regulator, then you will see 5 volts REGARDLESS of what the input does(assuming it's above about 7 volts); this can't be right.
i stepped down the 220 volts to 12 volts ac using a 12-0-12 transformer. Then i used a bridge rectifier circuit followed by 7805 regulator. This is then given RA0 PIN of pic for ADC. Does that effect the scenario? should i use a voltage divider circuit instead of 7805?
Do you have an emulator for the PIC, so that you can monitor internal signals?
actually its my first time that i am working with a PIC. so i do not have an idea regarding an emulator...please help me!
I would first look at your error signal and verify that it changes properly with respect to your two input voltages.
The error signal is just an output obtained from ADC values of the two inputs like ADC_VALUE2-ADC_VALUE1!! i have used just the upper 8 bits for this purpose instead of the 10 bits result. will dat effect my system to a great extent? how can i subtract two 10 bits ADC result in pic16f877A?
regards.
 

As I explained, I don't think you want that regulator! If your input is 220, the output of your transformer will be 12 Volts, and the output of your regulator (and input to your ADC) will be 5 volts. If your input is 220,000 volts, the output of your transformer will be 12,000 volts and the output of your regulator will be: 5V.

GET RID OF THE REGULATOR!!

You need to scale the voltage to whatever the ADC needs to see. For example, if the full-scale voltage of the ADC is 5V, then you need to add a voltage divider after your rectifier so that the maximum input voltage will produce a voltage of something less than 5V.
 
  • Like
Reactions: nirajd

    nirajd

    Points: 2
    Helpful Answer Positive Rating
Thank you Barry. let me just give a try replacing the regulator by voltage divider ckt. I will let you know the result!! Thanks for the help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top