Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PID pump control question

Status
Not open for further replies.

dsc

Member
Hi everyone,

I've got a pump which is being driven by a PIC, using a voltage signal and a pressure transducer for feedback. The main task for the PIC is to keep steady pressure in a small chamber by varying the voltage. The pump fills up the chamber and when it's full the pressure starts to rise, thus changing readings from the transducer.

I've got the PID loop pretty much figured out and tuned, but I'm having some problems with the initial phase of the whole process. Because there's a flow restrictor just before the chamber, it's takes a while for the pump to fill it, roughly 4-5s. This means that when the pump is started the pressure sits on 0bar for the first 4-5s and afterwards shoots quite quickly to 10bar (max possible pressure), causing an overshot pretty much everytime regardless of the setpoint in the system. This is caused by the PID controller rising the voltage to the maximum value during the initial phase, the controller 'thinks' the pressure isn't rising due to the control signal being too small and keeps increasing it until it reaches the max value. Of course when the chamber is full and the pump is running at full speed the pressure shoots up pretty quickly and the PID takes 2-3s to get down to the proper level.

So the question is, is there a way to avoid this? After the chamber is full the system is pretty responsive and I'm using a 1000ms sample loop interval for the PID to control the system which works well, it's only the initial phase that causes problems. I was thinking about putting a 3-4s delay between the pump ignition and PID startup, but I'd have to start the pump at full voltage (to fill the chamber quickly) and start the PID at zero voltage in order to make it work, so it won't work properly. It will either overshoot if I set the control signal to max when initiating the PID, or will dip down when I initiate it with 0.

Any ideas?

Regards,
dsc.
 
Last edited:
Omit differential control and just make it PI controlled. (You'll require D only if e.g. acellerating a motor.)

Use 50% proportional control and set the integral part for 1.5min initially. If the circuit reacts too slowly decrease timing or increase the P-value to 60%.

This worked well for air control maintaining a constant pressure of 50Pa with an initial overshoot of 2Pa, varying max. ±1Pa when stabilized.

You might also include tendency recognition and make the circuit "self-learning and -adjusting".

The sampling refresh rate however should be 10 to 50 per second.
 
Last edited:
1000ms sample loop interval is rather slow. Can you sample at a faster rate?
 
Why not just wait the 4-5 seconds after the pump started and then put the PID controller to Auto (if you have auto/man mode programmed), else give the pump a low reference until the pressure is within a range that you believe the PID will be able to handle before switching over to PID control.

I always have my PID controllers either in Manual or tracking mode while the equipment stream they are to control is not operational. That prevents integral windup.
 
re

Hi guys,

currently I have these settings:

kp = 1
ki = 0.25
kd=0

so it is indeed a PI controller.

Use 50% proportional control and set the integral part for 1.5min initially. If the circuit reacts too slowly decrease timing or increase the P-value to 60%.

Just to confirm, you are saying to use:

kc=0.5
ki=1.5 (or more)

and tackle slow response by increasing the sample rate? I will give it a go, shouldn't hurt.

I agree 1000ms is a bit slow and I can go lower (50ms is the minimum at the moment but I can change that), I used that value simply because the pump response was a bit slow and thus I thought it would be better to sample less frequently.

Why not just wait the 4-5 seconds after the pump started...

That was my initial idea, but if I start the pump in manual mode and apply max voltage to it, so that it runs at max speed and fills the chamber very quickly it's quite hard to switch back to auto mode without getting overshoot. The reason behind this is that with the control signal being at maximum when the PID goes to auto it's needs a moment to decrease it and that means overshot. I can't keep the signal to the pump at maximum and start the PID auto mode with control signal set to 0 as this will mean a sudden dip in pump speed when the PID takes over the control and keeps increasing the voltage from 0. I would really need the pump signal to sit at around 50%-75% before the PID kicks in, so it doesn't start at max control signal and even after a second or two it doesn't go way above the setpoint. This actually led me to the following idea:

What if I was to change the parameters of the PID after 4-5s (or when the pressure starts to rise)? that way I could have two controlers, one for the very slow/no rise phase to build up the pump voltage slowly, and one for the phase when the chamber is full and the pump is more responsive. The pump acts a bit like having two types of behavour, so I can use two different types of parameter sets to cope with that.

OR

Setting the controller to Manual mode, sitting at say 50% max output and when the pressure starts to rise switch to Auto mode.

I always have my PID controllers either in Manual or tracking mode while the equipment stream they are to control is not operational. That prevents integral windup.

So when you switch from Manual to Auto what happens to the control signal? I see this as a bit of a problem, unless you set the controller output to something quite small in Manual mode and leave it at that level when the PID Auto kicks in. Also can you explain tracking mode a bit more?

Just as a note this is a very simple 8-bit PID controller with an 8bit output value which is limited to 150. That corresponds to around 3V on the PWM output from the uC (0=0V, 150=3V). The pump itself is not super fast, it takes around 1000ms to see the changes of the voltage, so nothing happens quickly in the system.

Regards,
dsc.
 
Okay, I must admit, the PID controllers I use are all programmed within PLC environment. There I have many other function blocks that allows for tracking, bumpless changeover etc.

What tracking does is, the Process Variable (PV) is fed back into the PID controller (which is not in Automatic control mode, i.e. no internal calculations are taking place) and is passed on to the output value of the PID (Manipulated Variable (MV).)
Thus, When Tracking On -> MV = PV.

Once the PID controller is put to Automatic control, the calculation uses the current MV value, and from that value starts to do calculations, integrating either up or down depending on the process.

Simple PID controllers in a µ-controller is just that, quite simple in operation. There’s so much more that needs to be done outside to eventually get a bumpless transfer from Automatic to manual control modes.

Best of luck.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top