Making Power Smart

There are many applications for power supplies in this world and most of them simply need a clean, source of current or voltage to get the job done. A growing number of these applications are requiring the voltage or current be adjusted by some intelligent algorithm to improve performance, reduce power consumption or accomplish some new feature that makes a product more compelling in the marketplace.

Intelligently Controlled Power
There are many applications for power supplies in this world and most of them simply need a clean, source of current or voltage to get the job done. A growing number of these applications are requiring the voltage or current be adjusted by some intelligent algorithm to improve performance, reduce power consumption or accomplish some new feature that makes a product more compelling in the marketplace. Some of these applications include:

  1. Maximum power point tracking for solar power systems or energy harvesting.
  2. Battery charging, especially some of the more exotic chemistries.
  3. LED Lighting with dimming or daylight harvesting.
  4. Fault Tolerance through back-up power systems.

In each case, a microcontroller is added to execute some level of intelligent algorithm to manage the power more effectively. Other power systems simply require intelligence to interface with humans or other systems. These systems could be SMbus power components on a PC motherboard, LIN-interfaced lighting in a vehicle or Ethernet managed power panels in a large building. Simply adding communications to an existing product increases its’ utility and value by a few orders or magnitude.

Traditional Smart Power
The “brute force” approach for many smart power systems is to simply add an MCU to the existing power system. This is very low risk because the existing system accomplishes the task and is well understood. The new piece is simply the intelligence. This process usually involves adding sensing circuits for the voltages, currents, temperatures and perhaps other parameters such as duty cycle or frequency in the existing supply. Additional circuits maybe connected to control features of the existing supply such as enables and voltage set points. Many SMPS ASICs already have the necessary control inputs via I/O pins or I2C™ connections. There are many general purpose MCUs such as the PIC16F1939 that can interface with these ASICs and provide the interface, command and control to improve the functionality of the power supply.

Once the connection to the power supply is made and validated, the additional functionality can be quickly developed with standard development tools such as MPLAB® X IDE and PICkit™ 3. Generally this approach also does not require that the software development team be fully versed in the intricacies of SMPS design as the SMPS team independently validates that portion of the system.

Digital Power Supplies
In an effort to save costs, there is a strong desire to fully integrate the SMPS and the MCU. One method that is quite powerful is to use a high-performance MCU with a fast sampling ADC. This type of device allows a fully digital feedback system that is controlled with software. If the performance is high enough, then very complex feedback algorithms can be implemented in the software and the hardware can be kept quite simple. This approach is very attractive but there are a few points to consider.

  1. Traditional cut/jump debugging methods are not as effective when the ADC and algorithm must be included in the troubleshooting.
  2. The software team must understand the performance and math requirements of the SMPS compensation. Sometimes very subtle code changes dramatically affect stability.
  3. Power requirements of the controller increase with MIPS so computationally expensive algorithms will affect the system efficiency.

If these limitations are not a concern in a system then some pretty amazing things can be done with software.

Hybrid Smart Power
Somewhere between the simplicity of the “brute-force” approach and the fully digital approach lies a hybrid approach. In this method a mixed-signal controller with the necessary analog feedback peripherals and the necessary MCU features are combined on a single integrated circuit. One such device is the PIC16F753. The PIC16F753 integrates the operational amplifier (op amp), slope compensator, DAC, comparators and Pulse Width Modulation (PWM) controller into a single 14 pin microcontroller. Each of these peripherals is programmable and they can be combined in a variety of ways to create a large number of current mode power supplies. Because they are configurable in software, the configuration can be dynamically changed to adapt to the conditions of the power supply. For example, it may be appropriate to operate the power supply in a toy as a hysteretic controller with a simple firmware feed-forward regulator when the toy is in standby. When the toy is activated the supply can be quickly reconfigured for continuous current mode at a different operating frequency, ready for action. Because the entire power supply is being controlled inside the MCU’s peripherals, all of the needed sensing circuits are part of the SMPS and not added late in the design life. This has the potential of simplifying the design and reducing component count. The firmware may also benefit from additional visibility into the power supply’s behavior without adding new components. The power supply design process is nearly identical to traditional methods. The steps go as follows:

  1. Decide upon the power supply topology
  2. Create the supply and calculate the component values
  3. Configure the internal peripherals (20 lines of code)
  4. Validate the performance and tune the compensation network.
  5. Write the communications and intelligence interface.

Step 5 can be accomplished without detailed knowledge of the power supply because the peripheral configuration will be set and verified by the power supply engineering team.

Design Process

  • Decide the power supply topology
  • Create model and calculate component values
  • Configure the microcontroller peripherals for the power supply
  • Tune the analog feedback loop
  • Write the Communications & Intelligence Code

Common Configuration
Most power supplies built with the PIC16F753 are minor variations on a common SMPS configuration. This configuration is shown below.

In this configuration, the peripherals are configured to produce most current mode fixed frequency power supplies. The COG is the complementary output generator. Its function is to produce a complementary output with programmable deadband from rising and falling inputs. The CCP is configured to produce a programmable frequency rising edge. The comparator C1 produces the falling edge when the current exceeds the output of the slope compensator. The CCP can be combined with C1 to create a maximum duty cycle. The maximum duty cycle is needed for some topologies such as boost, flyback or SEPIC. The op amp OPA is used to provide feedback and compensation. Shown is the DAC providing the reference to the op amp but the Fixed Voltage Reference (FVR) can also be used to provide the op amp reference if programmable levels are not required. The slope compensator can be reset by the comparators or the COG. It works by using a programmable current sink to decay a capacitor that is precharged to the level set by its input (the OPA in this case). This power supply configuration is quite simple to use. Here is one example of a boost supply regulating current in an LED string.

 

Example Boost LED Power Supply

Once the HW has been constructed and tested. The intelligence can be added simply by implementing the basic functions such as the examples below:

LED Driver Flowchart

Maximum Power Point State Machine

Battery Charger State Machine

Conclusion
Adding an MCU to a power supply can make the final result far more potent than either device separately. The integration can take the form of simply bolting an MCU onto an existing SMPS design, building a fully digital SMPS with a high-performance dsPIC or using a mixed-signal MCU that integrates analog SMPS features with an MCU on a single chip.

To Top