Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple on/off SMPS controller beats PID software control.

Status
Not open for further replies.

zxt50

Electrical
Feb 19, 2008
9
GB
Hi,

Does any reader have knowledge about how good Programmable SMPS PWM controllers are? (using PIDJ software to do the PWM).
-That is, are they better or worse than standard 'analog' (non-programmable) PWM controllers?

('J' is for derivative of the derivative)

I have been running the Sync Buck Demo Board from Microchip. This board uses dsPIC30F2020 to control a Buck Converter with a switchable load.

I ran Microchip's PIDJ example code on this board and regulation was 300mV pkpk (switching from min to max load at T=1ms, 50% duty).

....Then, as an experiment, i programmed the dsPIC30F2020 to act as a SMPS regulator using nothing more than its on-chip comparator to control PWM.....

The equivalent circuit for this simple (non PIDJ) PWM controller is as follows....



-Surprisingly, just using the on-chip comparator provided significantly better regulation than using the PIDJ code provided by Microchip. I am surprised since i half expected Microchip's code to be written so as to perform excellent regulation, -so as to "show-off" their product.

I am wondering if any reader has any ideas about why the simple (non PIDJ) PWM controller gave superior performance to the example controller code which used PIDJ control and the DSP engine inside dsPIC30F2020?

-I am thinking of developing PIDJ code for PWM SMPS control but would like first to see that it really can give better performance than simple comparator PWM controllers as shown in the above link.

Does anybody know if programmable SMPS PWM control (using PIDJ algorithms) is flawed, when compared to simple 'analog' PWM controllers?
 
Replies continue below

Recommended for you

Hello zxt50.

I cannot say what your problem is as I haven't ever actually used the Microchip SMPS controller. I have twice seriously considered using it. And, in fact, both solutions you've tried. The hardware based one and the SW based one. In both cases I haired out at the last second going for a more customary dedicated controller.

I am quite disappointed by your SW experience.

The SW based one you are using is the DEV board as is, running the stock output, correct? If so I almost wonder if something isn't seriously wrong. 0.300V/5V = 6% ripple YUCK!

Perhaps you can find out who teaches the (312 DPS) at Microchip. The people teaching the courses really understand the dev boards. I took the class on the DSP motor control dev board and was very impressed with the knowledge that was there.

I would be hunting those particular individuals. There are usually about three people who are experts on any particular dev board. They would be very motivated to to make sure you have an answer to a poorly performing dev board.

Keith Cress
Flamin Systems, Inc.-
 
Hi, Thanks for you reply...

"The SW based one you are using is the DEV board as is, running the stock output, correct? "

...Yes indeed, this SW based one is the example in the User's Guide. The code is called "SMPS_PID_Control.s"

The User's Guide is...

The (non-PID SW) comparator-based controller had the same switching frequency, same dead time for the transitor and synchronous 'diode', same circuitry external to the dsPIC30F2020, same load switching etc etc.

I cannot really understand how the (non PID SW) comparator controller worked so well...In a separate experiment, I put a DC voltage on the comparator's (+) input at ~the reference voltage, and read the CMPSTAT bit in a loop, using it to turn on/off the on-board LED depending on whether comparator output was high or low......it oscillated very fast (~1MHz) so there can't be much hysteresis on it -since as said this was just a DC voltage from the pot on the Demo Board PCB going into the (+) input

...All said, I can't help but believe that some customers must surely have got the chip to regulate well using software PID. (pleeeeease show us?)... And the dsPIC has a whole host of features which really are good to have.
 
Why not modify gain coefficients to optimize ripple? (or play with them until you see some improvements) Sometimes you may need to tune the PID controller. PID design is generally far from perfect, where cookbook design is used, and even further when you go from your analog plant of a voltage regulator to your digital system of control (approximation of system in digital domain). There's lots of room for inaccuracy.

I'm not familiar with the devkit you are using, but perhaps your coefficients need more precision at the pwm frequency? 300mV ripple is considered terrible for many applications. Your reasoning for why the PID should be better than a comparator may be true or not. On the one hand, you want to show off your product with an amazing demo, on the other hand you are not writing an application, but only a demo and i doubt they would spend the time and effort to get solid design when that is not the boards only application. 300mV is not good enough for you, but they might have gotten that and called it a day.

The only way to do a software regulator right is to do solid control theory design, and you only need to know a few parameters/functionality specs of your processor to determine if it is right for your controller requirements: sampling rate (decision is based on a function of both clock frequency and amount of calculation that can be done between samples), and precision (you need more bits to represent your coefficients as your sampling rate increases, just like in DSP). Beyond these two parameters, you should rely on the specs of the processor rather than a demo to tell you if you can accomplish what you want with the processor in question.
 
Is the 300mv the peak deviation when the load switches?
IE. Transient response. Does the dsp run a filter before the
pid loop? What filtering is on the analog solution, you may have stability issues.
 
I would question the use of the 2nd derivative: "('J' is for derivative of the derivative)". Derivatives tend to be noisy, volatile terms and I am wondering if the control system is fighting itself.

 
Thanks Madcow for your reply..

1. "Is the 300mv the peak deviation when the load switches?
IE. Transient response.

2. Does the dsp run a filter before the
pid loop?

3. What filtering is on the analog solution, you may have stability issues."

answering here....

1. Its 300mV pkpk ripple at the load switching frequency.

2. I need to look at their code harder to answer that...but i don't think it filters it.

3. There's no filtering on the analog (non-PID) solution.

....though when you speak of instability, are you referring to the possibility of the non-hysteretic comparator going into oscillation and staying oscillating?......if that happened the SMPS output voltage would drop to virtually zero.

It would be difficult to get much of an overvoltage with the above (non-PID) controller because the comparator just slams the switch off when v(out) feedback goes above the comparator's reference, so at least if it went instable, there would be less possibility of damage...or do you believe au contraire?


 
From what I can tell, you are comparing two different control teqniques.The pid control and hysteretic control.
Hysteretic is great for load transients. The pid control on the demo is running at about 100k. It may take several itterations to respond.
It also has limit on the maximum change in duty cycle while the analog solution can go from 0 to 100% real fast. The software solution also has current limiting, so the amount of current that can be supplied to recharge the output is limited. I did not see any current or duty cycle limiting on the analog circuit. You may want to look at the inductor currents to see if there are large differences or saturation.
As far as stabillity, I never used a hysteretic controller, but the last paragraph in this article sugests some possible problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top