Forums

Opinion on Semi predictive feedback control

Started by Klaus Kragelund January 20, 2018
Hi

I got a power supply working in hysteresis mode with a not very precise reference 

So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value 

Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value

It works, but it will have a small ripple around the target value since that is the way it functions 

So I was thinking about predictive control. I have a model of the plant, so I know how much to modify the DAC to get it back on track from an error voltage. So I could just measure how much I am off target, and program the DAC with the correct correction including the model information 

This would let the output swing back to target very fast and very precise. I should then add logic so the DAC is not moved if the measured output is inside a certain error band. That would stop the ripple around the target value 

Any opinions on this? Stability issues?

Thanks 

Klaus
On Saturday, January 20, 2018 at 1:45:55 AM UTC-8, Klaus Kragelund wrote:

> I got a power supply working in hysteresis mode with a not very precise reference > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value
But, isn't that now a PI loop? And, with 'hysteresis mode'?
> It works, but it will have a small ripple around the target value since that is the way it functions > > So I was thinking about predictive control.
So, that's going to be PID control? With embedded hysteresis? Safest thing to do, is let it be noisy, because it's just a supply of POWER, and keep a highly-tweaked accurate secondary reference outside the loop. It's beyond me to know what would stabilize (or even accurately characterize) that feedback. Even if the feedback can be made to work under normal operation, the startup and shutdown transients are capable of unpleasant surprises. Disclaimer: I've debugged bunches of power supplies, but don't know much about fine tuning 'em.
On Saturday, January 20, 2018 at 11:32:27 AM UTC+1, whit3rd wrote:
> On Saturday, January 20, 2018 at 1:45:55 AM UTC-8, Klaus Kragelund wrote: > > > I got a power supply working in hysteresis mode with a not very precise reference > > > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value > > But, isn't that now a PI loop? And, with 'hysteresis mode'? >
Well, I don't think it's either because no matter how far the target is away, the speed is still just 1 LSB of the DAC per timeframe. A P term and a I term relates to the size of the error signal, which I do not here The hysteresis is the control of the SMPS, not the outside loop control. Cheers Klaus
"whit3rd" <whit3rd@gmail.com> wrote in message 
news:08c26373-9905-4abc-b7e5-7d4b0fd89389@googlegroups.com...
> But, isn't that now a PI loop? And, with 'hysteresis mode'?
No, that's nonlinear (constant slew rate), and also unstable. Seems to me, following a hysteretic control with a hysteretic control has a certain poetic awfulness to it. ;-) A linear process has the output change proportional to the error. Multiply the input error by a coefficient (and the error sum over time -- the integral term) and set the output to that. Keep track of fractional bits (say, using a 32 bit register, 16 of which feed the output) so that the output still changes (slowly, i.e. an LSB every however-many samples) when the input error is very small (a few LSBs). You might as well strip it back further, replacing the outside hysteretic controller with a PWM channel so you can do average current mode control. (Peak current mode control isn't practical on most MCUs.) I'm guessing you need to add a current shunt to do this, but it is well worth doing. Tim -- Seven Transistor Labs, LLC Electrical Engineering Consultation and Contract Design Website: https://www.seventransistorlabs.com/
In article <dfafb3ba-aed0-4b52-ab49-98873f41b93c@googlegroups.com>, 
klauskvik@hotmail.com says...
> > Hi > > I got a power supply working in hysteresis mode with a not very precise reference > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value > > It works, but it will have a small ripple around the target value since that is the way it functions > > So I was thinking about predictive control. I have a model of the plant, so I know how much to modify the DAC to get it back on track from an error voltage. So I could just measure how much I am off target, and program the DAC with the correct correction including the model information > > This would let the output swing back to target very fast and very precise. I should then add logic so the DAC is not moved if the measured output is inside a certain error band. That would stop the ripple around the target value > > Any opinions on this? Stability issues? > > Thanks > > Klaus
why not simply force the DAC to use close to its full range output and do an analgo scale to the power supply to correct it? If moving the DAC 1 bit is causing a ripple then you have way too much gain on it. scale the DAC output to the power supply reg circuits which will allow you to use a broad range of the DAC and tuhs have very little ripple. Jamie
On Saturday, January 20, 2018 at 4:46:39 PM UTC+1, M Philbrook wrote:
> In article <dfafb3ba-aed0-4b52-ab49-98873f41b93c@googlegroups.com>, > klauskvik@hotmail.com says... > > > > Hi > > > > I got a power supply working in hysteresis mode with a not very precise reference > > > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value > > > > It works, but it will have a small ripple around the target value since that is the way it functions > > > > So I was thinking about predictive control. I have a model of the plant, so I know how much to modify the DAC to get it back on track from an error voltage. So I could just measure how much I am off target, and program the DAC with the correct correction including the model information > > > > This would let the output swing back to target very fast and very precise. I should then add logic so the DAC is not moved if the measured output is inside a certain error band. That would stop the ripple around the target value > > > > Any opinions on this? Stability issues? > > > > Thanks > > > > Klaus > > why not simply force the DAC to use close to its full range output and > do an analgo scale to the power supply to correct it? > > If moving the DAC 1 bit is causing a ripple then you have way too much > gain on it. scale the DAC output to the power supply reg circuits which > will allow you to use a broad range of the DAC and tuhs have very little > ripple.
I want to get the best performance possible, just to see how far I can go I have 3V on the SMPS output, 12 bit DAC, so that is about 0.75mV/LSB. The DAC output has a 1 to 1 ratio to the output, so 1 LSB moves the output with 0.75mV The ADC is also 12 bit, so the same 0.75mV resolution. Off course I have some LSB jitter, but some of that is fixed by a moving average of the ADC counts. If I really wanted to push it further, I could jitter the DAC also to get higher resolution, but I really don't need to go that far I cannot add a lot of stuff due to cost reasons Cheers Klaus
In article <b0dfb337-e23c-4691-98e1-0c952c2eb5b4@googlegroups.com>, 
klauskvik@hotmail.com says...
> > On Saturday, January 20, 2018 at 4:46:39 PM UTC+1, M Philbrook wrote: > > In article <dfafb3ba-aed0-4b52-ab49-98873f41b93c@googlegroups.com>, > > klauskvik@hotmail.com says... > > > > > > Hi > > > > > > I got a power supply working in hysteresis mode with a not very precise reference > > > > > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > > > > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value > > > > > > It works, but it will have a small ripple around the target value since that is the way it functions > > > > > > So I was thinking about predictive control. I have a model of the plant, so I know how much to modify the DAC to get it back on track from an error voltage. So I could just measure how much I am off target, and program the DAC with the correct correction including the model information > > > > > > This would let the output swing back to target very fast and very precise. I should then add logic so the DAC is not moved if the measured output is inside a certain error band. That would stop the ripple around the target value > > > > > > Any opinions on this? Stability issues? > > > > > > Thanks > > > > > > Klaus > > > > why not simply force the DAC to use close to its full range output and > > do an analgo scale to the power supply to correct it? > > > > If moving the DAC 1 bit is causing a ripple then you have way too much > > gain on it. scale the DAC output to the power supply reg circuits which > > will allow you to use a broad range of the DAC and tuhs have very little > > ripple. > > I want to get the best performance possible, just to see how far I can go > > I have 3V on the SMPS output, 12 bit DAC, so that is about 0.75mV/LSB. > > The DAC output has a 1 to 1 ratio to the output, so 1 LSB moves the output with 0.75mV > > The ADC is also 12 bit, so the same 0.75mV resolution. Off course I have some LSB jitter, but some of that is fixed by a moving average of the ADC counts. If I really wanted to push it further, I could jitter the DAC also to get higher resolution, but I really don't need to go that far > > I cannot add a lot of stuff due to cost reasons > > Cheers > > Klaus
do you have an additional DAC to play with ? if so you can use that one to increase your resolution with a summing circuit. Of course you'll need to use some high precision R's to make that work out.
On Sunday, January 21, 2018 at 2:24:29 AM UTC+1, M Philbrook wrote:
> In article <b0dfb337-e23c-4691-98e1-0c952c2eb5b4@googlegroups.com>, > klauskvik@hotmail.com says... > > > > On Saturday, January 20, 2018 at 4:46:39 PM UTC+1, M Philbrook wrote: > > > In article <dfafb3ba-aed0-4b52-ab49-98873f41b93c@googlegroups.com>, > > > klauskvik@hotmail.com says... > > > > > > > > Hi > > > > > > > > I got a power supply working in hysteresis mode with a not very precise reference > > > > > > > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value > > > > > > > > Right now I have it working with a very simple P regulator, so if the value measured by the ADC is off target, I just move the DAC control one LSB to move the output back to the target value > > > > > > > > It works, but it will have a small ripple around the target value since that is the way it functions > > > > > > > > So I was thinking about predictive control. I have a model of the plant, so I know how much to modify the DAC to get it back on track from an error voltage. So I could just measure how much I am off target, and program the DAC with the correct correction including the model information > > > > > > > > This would let the output swing back to target very fast and very precise. I should then add logic so the DAC is not moved if the measured output is inside a certain error band. That would stop the ripple around the target value > > > > > > > > Any opinions on this? Stability issues? > > > > > > > > Thanks > > > > > > > > Klaus > > > > > > why not simply force the DAC to use close to its full range output and > > > do an analgo scale to the power supply to correct it? > > > > > > If moving the DAC 1 bit is causing a ripple then you have way too much > > > gain on it. scale the DAC output to the power supply reg circuits which > > > will allow you to use a broad range of the DAC and tuhs have very little > > > ripple. > > > > I want to get the best performance possible, just to see how far I can go > > > > I have 3V on the SMPS output, 12 bit DAC, so that is about 0.75mV/LSB. > > > > The DAC output has a 1 to 1 ratio to the output, so 1 LSB moves the output with 0.75mV > > > > The ADC is also 12 bit, so the same 0.75mV resolution. Off course I have some LSB jitter, but some of that is fixed by a moving average of the ADC counts. If I really wanted to push it further, I could jitter the DAC also to get higher resolution, but I really don't need to go that far > > > > I cannot add a lot of stuff due to cost reasons > > > > Cheers > > > > Klaus > > do you have an additional DAC to play with ? if so you can use that one > to increase your resolution with a summing circuit. Of course you'll > need to use some high precision R's to make that work out.
I think I have enough resolution, I just need it not to dance around the target value On a side note, the microcontroller that controls the outer loop knows the exact loading of the 3V supply, and when a potential load shift is happening In a normal supply regulator, a load step would cause the 3V to either overshoot or undershoot. It may be going a little over the top for this supply, but for sake of experiment, I could shift the DAC with 50% of the expected over/undershoot, to reduce the overall overshoot by 50% I guess this kind of stuff is patented heavily, so I need to do a patent survey Cheers Klaus
On 2018-01-20 01:45, Klaus Kragelund wrote:
> Hi > > I got a power supply working in hysteresis mode with a not very > precise reference > > So I am wrapping a digital loop with a microcontroller around it > using a DAC output to tune the reference and thus the output to a > precise value > > Right now I have it working with a very simple P regulator, so if the > value measured by the ADC is off target, I just move the DAC control > one LSB to move the output back to the target value > > It works, but it will have a small ripple around the target value > since that is the way it functions > > So I was thinking about predictive control. I have a model of the > plant, so I know how much to modify the DAC to get it back on track > from an error voltage. So I could just measure how much I am off > target, and program the DAC with the correct correction including the > model information > > This would let the output swing back to target very fast and very > precise. I should then add logic so the DAC is not moved if the > measured output is inside a certain error band. That would stop the > ripple around the target value > > Any opinions on this? Stability issues? >
I have designed a system that used this approach except there was no internal hysteric hardware loop and it wasn't a power supply. It was a multi-channel phase adjuster where several receivers had to be "phased together" at exactly xx degrees towards each other. The errors were measured, the processor looked at it, grabbed the required correction magnitudes from a look-up table and applied those. It worked very well and fast but you must know the plant (which you probably do if you have a model). If there is any chance that your plant could come back with an unforeseen fast load change reaction this method could become unstable. Long story short the client had a DSP on the board for a previous method that they couldn't get to converge properly. This DSP became largely unemployed and could have been replaced with a cheap 8-bitter or less. -- Regards, Joerg http://www.analogconsultants.com/
On Saturday, January 20, 2018 at 4:45:55 AM UTC-5, Klaus Kragelund wrote:
> Hi > > I got a power supply working in hysteresis mode with a not very precise reference > > So I am wrapping a digital loop with a microcontroller around it using a DAC output to tune the reference and thus the output to a precise value >
then you have ANOTHER reference to compare the results of the not precise reference against? then why not just use the more precise reference in the first place? without another reference, I don't see how you can improve the results? mark