A capacitor bank is used to store the energy between PWM pulses. An example of this is an array can put out 3A. That is stored in the capacitor bank half the time. With an ON pulse, 3A still comes from the panel and there is an additional 3A from the capacitor bank giving 6A total. Capacitors have internal resistance and inductance. Capacitors will heat up and fail if subjected to a lot of current over time. For unknown commercial grade capacitors I like to figure a half amp each. In my system I used about a dozen 330Uf 200V electrolytics from old PC power supplies.
The simplest method is to use a fixed set point. The A/D value is compared with that and the PWMcount is adjusted up or down. A dead band is needed to prevent continuous adjustment. When a major change is detected an additional change to the count is made to speed the transition. The upper and lower limits of the count are constrained. Narrow pulses at each extreme only result in heating of the switching device and are prevented. Delay reading A/D at least 100ms after PWM is changed to allow system to respond. For a fish pond pump, the code is the same except the upper PWM limit would be about 170. This can also be used as a diversion controller on a MPPT charge controller without diversion control. A second A/D would monitor the battery and allow diversion at power point when the battery is over 13.8V. Code has been made intentionally simple for clarity.
The picture is a test bed I used to gather data from a single 12V panel. The 150 boost converter on the topis connected directly to the panel and was used to create 35V. This would not be needed with more than one panel in series. The UNO kept the panel at the power point. The pot was adjusted for highest power on the meter. Two 5V gate FETs were driven directly through 100 ohm resistors. Sufficient at these levels. Prefer
driving with opto isolators which will protect the controller and provide a level shift. Nothing more complicated is needed at these speeds.
// A resistive voltage divider produces about 2V-3V at pin A0
// to give A/D count of about 500
// READ ANALOG VALUE AT PIN A0
panel = analogRead(0);
// A/D values go from 0 to 1023
// ADJUST PWM COUNT
// FAST RECOVER from high panel voltage at startup
if (panel > setpoint + 25) PWMcount = PWMcount + 1;
// FAST RECOVER from low panel voltage
if (panel < setpoint - -25) PWMcount = PWMcount - 1;
// NORMAL HIGH VOLTAGE RAMP UP
if (panel > setpoint + 2) PWMcount = PWMcount + 1;
// voltage is over setpoint
// NORMAL LOW VOLTAGE RAMP DOWN
if (panel > setpoint - 2) PWMcount = PWMcount - 1;
// voltage is under setpoint
// CHECK PWM LIMITS
// is count too high?
if (PWMcount >= 255) PWMcount = 255;
// is count too low?
if (PWMcount <= 0) PWMcount = 0;
// Set count to output?
PWM3 = PWMcount;
// PREVENT NARROW DRIVE PULSES
// is count too high?
if (PWM3 >= 245) PWM3 = 255;
// is count too low?
if (PWM3 <= 4) PWM3 = 0;
// PWM FET DRIVER OUTPUT PIN #3
analogWrite(3,PWM3);
// PWM values are between 0 and 255
a delay or additional program is needed
Reply
Quote
Notify
Remove