3.4 Perturb and Observe (P&O)

The P&O algorithm is easy to implement with a state machine-based approach. Assuming the converter is up and running, these steps are taken:

  1. Sample the input (panel) voltage and current with the 10-bit ADC. Oversample them by summing up 16 consecutive samples, then divide by four to get a 12-bit result for each. Calculate the product of these two ADC values (INT16 result) to get the input power in counts.
  2. Adjust the converter to an incrementally higher current by incrementing the internal set point DAC-5 (DAC++).
  3. Delay for a time to allow the converter to adjust to the new operating point.
  4. Repeat Step 1 to get the power at DAC++. Store this value.
  5. Drop the DAC value by an increment below the original operating point (DAC--).
  6. Delay for a time to allow the converter to adjust to the new operating point.
  7. Repeat Step 1 to get the power at DAC--. Store this value.
  8. Compare the resulting higher and lower DAC power values to the original power and set a result register indicating which way to go for more power (lower, none or higher).

The result of the MPPT algorithm will be used by the arbitration routine to adjust the converter's power up or down as needed. The minor changes to the operating point by the MPPT routine are typically not concerning for the safety of the battery. Once the MPPT routine is complete, the system returns to the original operating point. The charger state machine is responsible for making changes to the steady-state output power as needed for the safe charging of the battery.