nirajd
Junior Member level 1
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!
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!