Continuous weighing with a PID control.

pietervdb

Member
Join Date
Jun 2006
Location
Ghent, Belgium
Posts
67
Hello



I’m programming a weighing system for precision weigh feeders.

How is the setup build. We’ve got a feeder with a motor who is VFD controlled. (4-20mA), the feeder is placed on a load cell who is connected to a Siemens Siwarex module.( Precision: 1 digit is about 3grams. Load cell is made for 100kg, Siwarex is 15bit.)

Basic method:
Feeders runs at 100% for 1 minute, calculate the difference in weight multiply it with 60 and you have the max feed rate of your feeder. For example 20 kg/h.

When you want to dose at 13,2 kg/h, you set the VFD to 13,2 / 20 * 100 = 66%.

Now the product doesn’t move always at the same speed in the feeder and so I don’t always have 13,2 kg/h so I want to put an continuous control on it.

This is how i made it so far:

I start the feeder at 13,2kg/h or 66%.
Every five seconds I calculate the difference in weight and put this in a table, when I have five measurements I calculate the average. This average multiply with 3600 and divided by 5 gives me the actually rate in kg/u. Why five measurements? Because the difference in weight is not always the same and so the input for the PID would vary to much.

For PID control a use FB41 (Continuous Control with SFB 41/FB 41 "CONT_C").

My setpoint or “SP_INT” is 13,2 kg/h, my process variable or “PV_IN” is my calculated actually rate.

I and D action are for the moment disabled. P action or “GAIN” is set to 0,05 (It’s a slow process)

Now I have on the output or “LMN“ the percentage I have to add to the VFD frequency, up or down, to get my wanted setpoint. So I add the LMN value to the setpoint (“SP_INT”).

In code it looks like this: "DB85_PID_Unit".Unit[1].VOLUMETRICAL_LMN is the value of SP_INT before the PID runs.

O "DB83_Actual_Unit".Unit[1].PID_Unit
O "DB55_Fill_Unit".Unit[1].Refill
O "DB84_Doseer_Unit".Unit[1].Locked
= L 18.0
A(
A L 18.0
A(
L "DB85_PID_Unit".Unit[1].LMN
L "DB85_PID_Unit".Unit[1].LASTLMN
<>R
)
FP DB85.DBX 148.0
JNB _005
L "DB85_PID_Unit".Unit[1].VOLUMETRICAL_LMN
L "DB85_PID_Unit".Unit[1].LMN
+R
T "DB85_PID_Unit".Unit[1].VOLUMETRICAL_LMN
AN OV
SAVE
CLR
_005: A BR
)
JNB _006
L "DB85_PID_Unit".Unit[1].LMN
T "DB85_PID_Unit".Unit[1].LASTLMN
_006: NOP 0
A L 18.0
JNB _007
L "DB85_PID_Unit".Unit[1].VOLUMETRICAL_LMN
T "DB85_PID_Unit".Unit[1].OUTPUT_VSD_PERCENT
_007: NOP 0

Every time the output LMN changes the frequency is recalculated. You can’t just continuous add the “LMN” value to ”SP_INT” because when LMN + SP_INT reaches the setpoint that is needed for my actually rate, the PID change the LMN value to zero percent and so it falls back on the setpoint frequency.

For example setpoint = 11kg/h (or calculated 55% VFD frequency). “PV_IN” is calculated first LMN output = 2,81 -> new VFD frequency 57,81%. “PV_IN” is calculated second LMN output = 0,56 -> new VFD frequency 58,37%, “PV_IN” is calculated third LMN output = -1,01% - new VFD frequency 57,36% and further on.

But here is the problem when I add the “I” action, the manipulated value “LMN” changes every moment and so every time “LMN” is added to the setpoint and in no time the VFD frequency change to a 100% or to 0% and back to a 100%. Even when LMN changes only 0,00001 the LMN value is added to the VSD frequency.

Now I’m looking for a way to program the VSD frequency on changes of LMN but it must be independent of the first non PID VSD frequency. It can use the first VSD frequency as start but further on It can’t be use any more. This is because when something happened during the maximum rate test, all other calculations would be wrong.

Does anyone have some advice? Maybe an other way of calculating my process variable (PV_IN).

Thanx

Pieter
 
dear peter,
i have one Hassia make filling system but its servo based system n just for 2kg max.
its a three head filler.
But as per the performance its not a value for money deal.
You know what ..............siwarex modules hav 50hz A/D conversion rate where as Omrons F159 is capable of doin the same with 500hz rate.................................................correct me if i am wrong.

Lets workout for better results.
 
I may not be reading your explanation correctly but it sounds to me like you are modifying the setpoint to a PID controller with the output of the same controller. This seems like a bad idea to me. The problem you indicate is at least one of the reasons.

You are using a reasonably developed feed forward, which is good. But you need to understand the nature of your error. In a flow application like this the error is due to an offset between the required motor speed and the actual motor speed. This offset will always be there. So your correction must also always be there. As you stated proportional correction will diminish as error diminishes. Cranking up your setpoint to achieve the required output from a proportional only term is probably not the way you want to go.

You need to start adding some integral correction. Integral correction will provide the continuous offset you need to keep your feed rate where you want it. However, you will need to be a little careful with your integral since you are filtering your feedback so much. If you make your integration time too fast you run the risk of oscillation.

Keith
 
When i add an integrator (PI controller), the results are very bad. Even with the integration time very very slow.

My problem with this controller is that the output you get is a percentage that the VFD has to run faster or slower not the percentage of how fast he has to go.

Let me explain. You calculate that for 10kg/h your VFD has to run at 50% but for some reason unknow (Mechanical, product related or wrong calculated) it has to run at 60%.

This is how the PID controller works now:

Input:
Setpoint: 10kg/u (50% VFD speed)
Actual: 8,33kg/u (50% VFD speed)

Output: 10%

I'm running at 50% i add the 10% = 60%. VFD speed = 60%

Now is running at the correct dosing.

The next calculation of the PID controller.

Input:
Setpoint: 10kg/u (50% VFD Speed)
Actual: 10kg/u (60% VFD Speed)

Output: 0%

The basic setpoint is still 50% and now it add's 0% so its back to 50% VFD speed and we are back to the beginnen because next calculation of the PID the output will be again + 10% and so on.

So with this method i get a controller that goes continuously up and down from theoretical VFD speed to actual VFD speed.

So i made a modification, instead of continuously adding the output from the PID to the theoretical VFD speed, it will add the output percentage too the precious VFD speed.

VFD speed = VFD speed + PID output.

It does this everytime the PID output changes. The problem with this method is that when you use a integrator, the PID output changes every second or faster. And so changes the VFD speed in no time from setpoint to zero and back up to a 100%.

When i change the formula to:

VFD speed = VFD speed * (( 100 + PID output)/100)

It didn't worked that good either.

I need a method who can independent give me the VFD speed i want.

Input:

Setpoint: 10Kg/h
Actual: 9 Kg/h

Output: 60%

So when the controller start, the output is 100% and when the controller reaches its setpoint its slows down too the speed until the speed is the actual speed neccesary for the correct dosing.

I also needs the possibility of starting of a given setpoint (50% instead of going immediately to a 100%)

Does anybody has some ideas that i can use to work this out?

Thanx
 
Im my opinion I think your getting a little too fancy.


If you just want to sustain a constant feed rate then use that as your setpoint and give the PID chance to control it.
By taking your output and using that to modify your setpoint (which it will do almost instantaneously) you are not giving the PID any chance to do its thing.

If you REALLY have to use the ouput to modify the setpoint then at least put a delay in the loopback to give the system some lag and the PID chance to keep up.

Myself I would put a time filter on the PV calculation to take out the bumps and dips in the weight differences, set a feed rate setpoint and concentrate on letting the PID do its thing.
 
I'm going to have to agree with kamenges, you don't want to modify your setpoint for the PID controller. Instead of putting a PID loop on the motor control frequency, put it on the flow setpoint and actual. Then the PID output PID.CV could be sent to the drive.

I'm assuming that the VFD is controlling a screw style feeder. If that is the case, the flow of the screw is not perfectly linear from 0% - 100% speed range. But the relationship does generally hold from max flow to max flow. Let me explain.

If at max flow (100% on the VFD) you are getting 10 kg/h
At 50% on the VFD you are getting 6 kg/h
At 10% on the VFD you are getting 3 kg/h
THEN
If at max flow (100% on the VFD) you are getting 100 kg/h
At 50% on the VFD you are getting 60 kg/h
etc...

This should give you a better model so that you won't need to have your P term too high.
 
I think another problem may be that you are trying to run your continuous control loop slower than your process. Your system is changing much faster than you are looking at it or chaning your contol output.

It sounds like you feel more comfortable doing a more discrete, model-based system. Try this on for size and see how it works for you. Don't use the continuous controller at all. Calculate your baseline motor speed command just as you do now. Add in a summed value based on the error. The equation would be something like:

Correctionn = Correctionn-1 + (K * error)

The total VFD speed command would be:

VFD_Speed = Baseline_Speed + Correction

You can only run this once every 25 seconds. You are taking a reading every 5 seconds and you are averaging 5 readings. You don't want to be looking at any old or intermediate data when you decide if your correction made a difference. In effect I am having you build your own integral only controller with feed forward.

Also, as baref00t25 alluded to, make sure your baseline model is correct. The closer you can get to the correct baseline speed the better off you will be. In addition, you probably may need to run without control correction until you are sure your screw is as full as it is going to get.

Keith
 
Hi pietervdb

I have done a system like you are. I had a Weighing transmitter with Profibus. 3 load cell 100 kg, Dosing range 300-1500 kg/h. Screw speed controlled by VFD.



I made weight samples every 200 mSec. I made a “prefilter” checking samples was in expected range. If the sample OK transfere to a FIFO with 30 samples.

Made an average and send that average into a low pass filter.

The output of the filter I used as my PV signal in a PI loop.

I can get a very stable flow but for start-up and when change SP I had to make a small sequens that changed the OP from PID to value calculated from the screw capacity.





Banker
 
Banker said:
Hi pietervdb

I have done a system like you are. I had a Weighing transmitter with Profibus. 3 load cell 100 kg, Dosing range 300-1500 kg/h. Screw speed controlled by VFD.



I made weight samples every 200 mSec. I made a “prefilter” checking samples was in expected range. If the sample OK transfere to a FIFO with 30 samples.

Made an average and send that average into a low pass filter.

The output of the filter I used as my PV signal in a PI loop.

I can get a very stable flow but for start-up and when change SP I had to make a small sequens that changed the OP from PID to value calculated from the screw capacity.





Banker

Do you use a Siwarex (U or FTA) to measure you weightvalue? Or do you have an other system? Because 300kg/u is about 16,66 gram every 200ms, you'll need a scale who is very stable and accurate. I can't make weight sample's every 200ms because i dose from 10kg/u to 70kg/u. And when i use a Siwarex U i only have a accuracy of 3gram per digit. Using 1 loadcell of 200kg. A siwarex U is 16bit.
 
Not putting alot of thought into this (sorry, busy day), but wouldn't this be a good application for Output Bias in the PID? As an example, if you have a setpoint of 50 kg/u and you know that should be theoretical 50% speed, then load your PID output with a bias of 50%. If the error is zero, then the output of the PID is 50%. As the error increases, the output decreases accordingly from 50%. Conversely, if your actual measured flow is less (-error), then your output increases. But it is always centered around your bias which is your known theoretical speed for a given flow demand.

Then, the output of the PID becomes the drive setpoint directly.
 
But if you miscalulate your theoretical speed, you'll never get a good result. After a while the output of the PID will for example be 50% + 25% and when the PID reaches its given setpoint it will slow down again. It will never be stable.
 
pietervdb said:
But if you miscalulate your theoretical speed, you'll never get a good result. After a while the output of the PID will for example be 50% + 25% and when the PID reaches its given setpoint it will slow down again. It will never be stable.

Huh? If the PID reaches 70% in order to drive the error to zero, it WILL NOT slow down again, unless the error starts going the other way (overshoot). That's not how a PID works.
 
Last edited:
Input: wanted (theoretical calculated) 50%, feedback from loadcell (calculated) 47%
Output: PID output value, for example, is 3%. Speed given to drive 53%.

Feedback from loadcell gets better because the drive increases his speed. Calculated feedback from loadcell is now 51%. PID reacts and output value from the PID is now -1%. Speed given to drive is 49%.

Feedback from loadcell is getting worse because the drive decreases his speed. calculated feedback from loadcell is now 45%. PID reacts and output value from the PID is now +5%. Speed given to drive is now 55%.

And so on.

When we miscalulate the theoretical speed, the result is even worse.
 
Dosing system

pietervdb said:
Do you use a Siwarex (U or FTA) to measure you weightvalue? Or do you have an other system? Because 300kg/u is about 16,66 gram every 200ms, you'll need a scale who is very stable and accurate. I can't make weight sample's every 200ms because i dose from 10kg/u to 70kg/u. And when i use a Siwarex U i only have a accuracy of 3gram per digit. Using 1 loadcell of 200kg. A siwarex U is 16bit.

No the system don't have do bee very stable. I do a average over 30 sampels.
If you have problem with flow stability it can be because the total weight ( Bin + Granulat ) is to high compare with the dosing rate
Weight / Dosingrate.

Banker
 
Possible.

Bin + Granulat is about 170kg. But don't you need to refill all the time?

300Kg for bin + granulat at a max rate of 1500kg/h. How much does your bin weighs?
 

Similar Topics

Hi Guys, I'm new to controls and PLCs and this might have a trivial answer. I have a small project with a PLC and a inverter. The inverter...
Replies
25
Views
3,614
Curios on the thoughts of using Continuous vs Periodic tasks. . The old SLC-500's mostly only had Continuous tasks. . The Compact & Control...
Replies
49
Views
13,689
Can anyone explain to me why Rockwell thinks a Continuous task is better than a Periodic task? That is what it defaults to. It may cause your...
Replies
10
Views
2,889
I've got an SLC500 running a 1746-hstp1 controlling a stepper motor. What's the best way to set the motor to run continuously? I only see Jog...
Replies
10
Views
3,111
We have a cutting machine that we designed in house. It uses an encoder to follow the motion of the product and a cam instruction to cause the...
Replies
20
Views
8,135
Back
Top Bottom