Wednesday, 28 August 2013

Sun tracking of solar panel with MPPT charge controller.

Achieving  Optimal  Power Point  Of  Solar  Cell Using  Sun   Tracking And  Maximum Power Point Tracking  Method

Basics of solar cell:

A solar cell or photovoltaic cell is a device that converts light directly into electricity by the photovoltaic effect. Sometimes the term solar cell is reserved for devices intended specifically to capture energy from sunlight, while the term photovoltaic cell is used when the light source is unspecified. Assemblies of cells are used to make solar panels, solar modules, or photovoltaic arrays.
Objective:
         Longer Backup
         Required Efficiency>15%
Modification:
         Modification of solar panel by LDR sensors
         Rotation of panel by Dc gear motors
         Optimal point achievement by MPPT
Hardware Implementations:
         Sun Tracking through Motors and Driver circuit
         Protection of batteries through PIC controller and RELAYS
         Optimal point achievement by buck circuit
         Conversion of DC power into AC power by full wave INVERTER
Proposed Solution:
Using Hardware:
We have designed all the following circuits.
·         Sensor placement on the panel for tracking
·         Motors placement for tracking

·         Motor driver circuit for tracking of panel
·         Charging protection circuit for battery
·         Buck circuit for MPPT implementation
·         Full wave inverter for DC to AC conversion

I.Sensor placement on the panel for tracking:
First we have to select proper sensor for the tracking to detect the light from our source. Now we have choice between different sensors as LDR sensors and PHOTO DIODE and different other sensors which were available in market .LDRare commonly used in market and photo diode are not so common as LDR are. For real time analysis photo diode are best and as LDR are very sensitive for light as compared to photo diode .we are using LDR  as we are using it in demo but these will be replaced by photo diode in case of real time analysis .
            

We have put sensors in 7 different to fully track the source. Four sensors in four sides of panel and one sensor in center of the panel and two in the bottom side to check that either source is in back position or in the front .our first priority are these sensors then we will compare other sensors for movement. We will get the output from these sensors and give it to comparator and comparator compares this and these comparators are in pic micro controller.

II.Motors placement for tracking:
We have placed two dc gear motors in two different positions for the two dimensional rotation of panel. DC gear motors are very efficient in rotation and especially in our case of tracking. These motors are very sensitive to movement and polarity. And movement control is easy as compared to stepper and servo motors. And to stand on one position is very necessary in our case and stepper motor can’t do it because it needs constant energisation for this purpose and it will drain the battery after some time and we could not risk the efficiency of our system and we need two movements and one is azimuth and other is             movement .we have used chains that are used in bikes as timing chains to rotate the panel
              

III. Motor driver circuit for tracking of panel:

We have chosen PIC microcontroller (18F452) for this sun tracking circuit because it has 8 pins for ADC and two pins for PWM pulse width modulation. We have applied 5 volt across LDR’s in series with resistors. Then we have given an input through a wire to the ADC of PIC microcontroller and we took this wire connection from B/W the LDR and resistor. After that we took four outputs from PIC micro controller and then we put these wires as input into the ic ULN 2003 for the relay driver operation. As PIC controller gives us 5 volts and to drive the relay we need 12 volts so to reach that voltage level we fulfill these volts by the help of this ULN 2003.And we put 12 volts into the pin #9 of ULN 2003.Then we took four wires as output from ULN 2003 and connect them into the four points of relays and give 12 volts to the other remaining points of relays.
Fig .3

Then we took a MOSFET and we ground its source pin and attached its drain with the switching pin of relay and at its gate we connect a pin from PIC controller by which PWM input will be sent to the relay and its working is according to the PIC input. After that we design another part of the circuit same as like we have design before with two relays and one MOSFET.And after that we apply another 12 volt on one pin of all relays and attach remaining pins to the two DC gear motors .

IV. Charging protection circuit for battery:
In this circuit we are using PIC controller. And we have taken two inputs one from solar panel and one from the battery. And we are checking the solar panel and battery voltage level and we are then indicating this voltage level and displaying these levels on the LCD attracted on D port. Then we take a relay and a ic ULN 2003 and a MOSFET .We connect this ULN 2003 with the PIC controller by the four wire connection  which are coming from PIC controller  as output as going into the ULN 2003.And we have connected this MOSFET which we have connected in our circuit.
The source of this MOSFET is grounded and drain is connected to the relay and its gate is attached to the controller and PWM is coming as input to the MOSFET from the controller. And we have attached a resistor and diode in parallel to the relay and capacitor also in parallel to the relay these all things prevent the back current and protect our relay from damage. When this circuit works relay trips and these LED’s blink and show the battery condition that either it is low or high or it is in medium state.

V. Buck circuit for MPPT implementation:
For the MPPT implementation to get our required power for charging purpose we have designed a buck circuit whose input is variable as input voltages coming from the panel vary from time to time as intensity of light increases or decreases depending on the weather condition. Our input varies from 12 to 17 volt and we need 13 volt for the proper battery charging and our inductor setting is so that it gives us 13 volt on the output terminal and from this we are charging our battery. And we could control the chopping frequency by the pulse width modulation and the PWM input sense the voltages and then change its input to make it 13 volt to charge the battery.



Monday, 19 August 2013

PROPORTIONAL INTEGRAL DERIVATIVE CONTROLLER (begginer)

PID controller is a generic control loop feedback mechanism (controller) widely used inindustrial control systems. A PID controller calculates an "error" value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error by adjusting the process control inputs.


Anatomy Of A Feedback Control System

Here is the classic block diagram of a process under PID Control.
What’s going on this diagram?
The Setpoint (SP) is the value that we want the process to be.
For example, the temperature control system in our house may have a SP of 22°C. This means that
we want the heating and cooling process in our house to achieve a steady temperature of as close to 22°C as possible”
The PID controller looks at the setpoint and compares it with the actual value of the Process Variable (PV). Back in our house, the box of electronics that is the PID controller in our Heating and Cooling system looks at the value of the temperature sensor in the room and sees how close it is to 22°C.
If the SP and the PV are the same – then the controller is a very happy little box. It doesn’t have to do anything, it will set its output to zero.
However, if there is a disparity between the SP and the PV we have an error and corrective action is needed. In our house this will either be cooling or heating depending on whether the PV is higher or lower than the SP respectively.
Let’s imagine the temperature PV in our house is higher than the SP. It is too hot. The air-con is switched on and the temperature drops.
The sensor picks up the lower temperature, feeds that back to the controller, the controller sees that the “temperature error” is not as great because the PV (temperature) has dropped and the air con is turned down a little.
This process is repeated until the house has cooled down to 22°C and there is no error.
Then a disturbance hits the system and the controller has to kick in again.
In our house the disturbance may be the sun beating down on the roof, raising the temperature of the air inside.
So that’s a really, really basic overview of a simple feedback control system. Sounds dead simple eh?

Understanding the controller

Unfortunately, in the real world we need a controller that is a bit more complicated than the one described above, if we want top performance form our loops. To understand why, we will be doing some “thought experiments” where we are the controller.
When we have gone through these thought experiments we will appreciate why a PID algorithm is needed and why/how it works to control the process.
We will be using the analogy of changing lanes on a freeway on a windy day. We are the driver, and therefore the controller of the process of changing the car’s position.
Here’s the Block Diagram we used before, with the labels changed to represent the car-on-windy-freeway control loop.
Notice how important closing the feedback loop is. If we removed the feedback loop we would be in “open loop control”, and would have to control the car’s position with our eyes closed!
Thankfully we are under “Closed loop control” -using our eyes for position feedback.
As we saw in the house-temperature example the controller takes the both the PV and SP signals, which it then puts through a black box to calculate a controller output. That controller output is sent to an actuator which moves to actually control the process.
We are interested here in what the black box actually does, which is that it applies 1, 2 or 3 calculations to the SP and Measured PV signals. These calculations, called the “Modes of Control” include:
  • Proportional (P)
  • Integral (I)
  • Derivative (D)

Under The Hood Of The PID Controller

Here’s a simplified block diagram of what the PID controller does:
It is really very simple in operation. The PV is subtracted from the SP to create the Error. The error is simply multiplied by one, two or all of the calculated P, I and D actions (depending which ones are turned on). Then the resulting “error x control actions” are added together and sent to the controller output.
These 3 modes are used in different combinations:
P – Sometimes used
PI - Most often used
PID – Sometimes used
PD – rare as hen’s teeth but can be useful for controlling servomotors.

Derivatives

Go into the control room of a process plant and ask the operator:
What’s the derivative of reactor 4’s pressure?”

And the response will typically be:
Bugger off smart arse!”

However go in and ask:
What’s the rate of change of reactor 4’s pressure?”

And the operator will examine the pressure trend and say something like:
About 5 PSI every 10 minutes”

He’s just performed calculus on the pressure trend! (don’t tell him though or he’ll want a pay raise)
So derivative is just a mathematical term meaning rate-of-change. That’s all there is to it.

Integrals without the Math

Is it any wonder that so many people run scared from the concept of integrals and integration, when this is a typical definition?



What the!?!?
If you understood that you are a smarter person than me.
Here’s a plain English definition:
The integral of a signal is the sum of all the instantaneous values that the signal has been, from whenever you started counting until you stop counting.
So if you are to plot your signal on a trend and your signal is sampled every second, and let’s say you are measuring temperature. If you were to superimpose the integral of the signal over the first 5 seconds – it would look like this:
The green line is your temperature, the red circles are where your control system has sampled the temperature and the blue area is the integral of the temperature signal. It is the sum of the 5 temperature values over the time period that you are interested in. In numerical terms it is the sum of the areas of each of the blue rectangles:
(13 x 1)+(14x1)+(13x1)+(12x1)+(11x1) = 63 °C s
The curious units (degrees Celsius x seconds) are because we have to multiply a temperature by a time – but the units aren’t important.
As you can probably remember from school –the integral turns out to be the area under the curve. When we have real world systems, we actually get an approximation to the area under the curve, which as you can see from the diagram gets better, the faster we sample.

Proportional control

Here’s a diagram of the controller when we have enabled only P control:
In Proportional Only mode, the controller simply multiplies the Error by the Proportional Gain (Kp) to get the controller output.
The Proportional Gain is the setting that we tune to get our desired performance from a “P only” controller.

A match made in heaven: The P + I Controller

If we put Proportional and Integral Action together, we get the humble PI controller. The Diagram below shows how the algorithm in a PI controller is calculated.
The tricky thing about Integral Action is that it will really screw up your process unless you know exactly how much Integral action to apply.
A good PID Tuning technique will calculate exactly how much Integral to apply for your specific process - but how is the Integral Action adjusted in the first place?

Adjusting the Integral Action

The way to adjust how much Integral Action you have is by adjusting a term called “minutes per repeat”. Not a very intuitive name is it?
So where does this strange name come from? It is a measure of how long it will take for the Integral Action to match the Proportional Action.
In other words, if the output of the proportional box on the diagram above is 20%, the repeat time is the time it will take for the output of the Integral box to get to 20% too.
And the important point to note is that the “bigger” integral action, the quicker it will get this 20% value. That is, it will take fewer minutes to get there, so the “minutes per repeat” value will be smaller.
In other words the smaller the “minutes per repeat” is the bigger the integral action.
To make things a bit more intuitive, a lot of controllers use an alternative unit of “repeats per minute” which is obviously the inverse of “minutes per repeat”.
The nice thing about “repeats per minute” is that the bigger it is - the bigger the resulting Integral action is.

Derivative Action – predicting the future

OK, so the combination of P and I action seems to cover all the bases and do a pretty good job of controlling our system. That is the reason that PI controllers are the most prevalent. They do the job well enough and keep things simple. Great.
But engineers being engineers are always looking to tweak performance.
They do this in a PID loop by adding the final ingredient: Derivative Action.
So adding derivative action can allow you to have bigger P and I gains and still keep the loop stable, giving you a faster response and better loop performance.
If you think about it, Derivative action improves the controller action because it predicts what is yet to happen by projecting the current rate of change into the future. This means that it is not using the current measured value, but a future measured value.
The units used for derivative action describe how far into the future you want to look. i.e. If derivative action is 20 seconds, the derivative term will project the current rate of change 20 seconds into the future.
The big problem with D control is that if you have noise on your signal (which looks like a bunch of spikes with steep sides) this confuses the hell out of the algorithm. It looks at the slope of the noise-spike and thinks:
“Holy crap! This process is changing quickly, lets pile on the D Action!!!”
And your control output jumps all over the place, messing up your control.
Of course you can try and filter the noise out, but my advice is that, unless PI control is really slow, don’t worry about switching D on.