Re: PID question



hondgm@xxxxxxxxx wrote:
I'm working on a linear bench power supply using a microcontroller. My
plan is to have a DAC set the output voltage, which will be regulated
by a simple op-amp circuit.
An analog input on the micro will monitor load current. I plan on
using this value to provide current limiting, via a PID algorithm
controlling the set voltage. Some general PID tuning advice in a
Microchip PDF says to first set Kp (with Ki and Kd set to 0) so the
system is as stable as possible.

With only Kp set, the voltage output just follows the error. Not too
helpful. Things got better when I added Ki. I'm not sure if I need
Kd. This seems like a somewhat difficult problem because anything can
be connected as a load.

I've searched the Internet, but nobody seems to be using PID in this
way. I'm sure it is being done, however. What is some general advice
on tuning this PID system? So much information out there seems to be
related to motors and heaters.

In general, I think a current control loop has to react much faster than a voltage control loop. One way to accomplish this is to have two PID controls, a fast one that controls current, and a slow one than controls voltage, by modifying the setpoint for the current loop. This is called a cascade controller (a single output controlled by two measured variables, one slaved to the other. You implement current limit by having a low selector at the current controller setpoint. In other words, the actual current controller setpoint is the lower of, the current limit value, or the output of the voltage controller. Both the setpoint for the voltage controller, and the current limit value can come from your DAC.

As to tuning the controllers, a visual method is quite effective, if you have a load stepper that provides the loops with clean, repeatable steps that you can sync a scope to. If you need help with the tuning concepts based on observing the time response of a PID control loop, I wrote a tutorial (focused on industrial process control, but applicable to any PIC controller) available at:
http://www.tcnj.edu/~rgraham/PID/popelish.html

You would tune the current controller, first, with only the limit setpoint in effect, then tune the voltage controller supplying the setpoint for the current controller.
.



Relevant Pages

  • Re: Student Question on using a PID as a Dimmer to Control a Light Bulb!!! This is a fun one!!!!!!
    ... find a PID that has a continuous analog output ... the controller has to have either a voltage output or a current output that is compatible with the phase power controller relay. ... So, if the power comes from a 60 Hz line frequency, you get 120 power pulses per second, which is fast enough for the lamp to have very little flicker. ...
    (sci.engr.control)
  • Re: Strange control problem -- 3 phase "firing system"
    ... Another line of thought is that the controller assumes that the low ... Voltage sensor is not differential, ... adjust the pot slowly, there seems to be less wobble. ... Double check that my divider for voltage feedback is correctly done. ...
    (sci.electronics.design)
  • Re: Welding -- what to do about HUGE 2" arcs
    ... controller which wants a DC voltage limit signal, ... when current is above some threshold, in the same analog computer ... You need to get those voltage and current signals properly scaled, ...
    (sci.electronics.design)
  • Re: 100kHz SMPS control
    ... ADC feedback of the output voltage and current fed into a DSP which ... that it would be better to use a SMPS controller IC with voltage and ... input into a DSP or CPLD/FPGA for controlling the primary side ... worthwhile to have some hardware gating to prevent doing something real ...
    (sci.electronics.design)
  • Re: 100kHz SMPS control
    ... ADC feedback of the output voltage and current fed into a DSP which ... that it would be better to use a SMPS controller IC with voltage and ... input into a DSP or CPLD/FPGA for controlling the primary side ...
    (sci.electronics.design)