PLC-5 PID Question

hoytman

Member
Join Date
Mar 2011
Location
Ontario
Posts
10
Hi all,
I've been a long time follower of this forum, but this is my first time posting.
I'm dealing with a PLC5/20 and was hoping to get better control out of a PID loop. We are currently reading the level of a tank and trying to maintain a SP of 6.5 however the PV is an integer so it bounces around either 6 or 7. The PID block is a PD which says I can use floating values. I found a previous post that said the resolution is never going to be that great due the AI being scaled 0-4095, but I'm wondering if I have any other options to attain greater control? The engineering units on the PID setup screen are set from 0 to 4095. Would it make a difference if I set that 0-100? If so, has anyone ever changed this online (The manual says not to because it might fault the processor)?

Thanks in advance for any advice.
 
Sorry Ron... I'm not sure if my employer would allow posting our code. I accept that it may be dificult now to get a proper response, so thanks anyway.
 
If you can't post the program you'll need to give a lot more detail.

What does 0-4095 scale to in Engineering Units? 0 - 10, 0 - 100, 0 - 12345?

Of the scaled range, how much of that range does the actual process use?

How do you know that you aren't controlling at 6.5? Yes I understand the display and program is bouncing between 6 and 7, but that is a function of the measuring device. What is actually happening in the tank? Surely the actual level is not 6 then 7, it is at some unmeasurable value between 6 and 7. How haven you determined that you need tighter control?

If your level control is bouncing between 6 and 7 given your current limitations I would say you're doing pretty good! But, if it was bouncing between 3 - 9, then I would agree it needs to be looked at.
 
I'll need to look into what the scaling is on the transmitter... I'm thinking 0-10. Looking at the trending, I'm running anywhere from 6.5 to 8.5. When I'm online and looking at the PID setup screen whenever the level is < 6.5 the PV is 6 and > 6.5 the PV is 7 and with that comes a corresponding jump in CV by at least 5% which is constantly happening. This is my first time with using PLC5 so I'm still getting used to it. Thanks.
 
If the PV is really scaled to 0 - 10, there is a method to extrapolate a decimal value out of the raw integer data. If you look at other analogs in your PLC5 you may discover it....

Re-scale your PV from 0-10, to 0-100. You are adding a factor of 10 to your scaling. Now, divide the newly scaled PV value by 10. Put the result into a floating point address...

First: Rescale from 0 - 100
Second: Divide by 10 into a floating point address
N7:0 / 10 = F8:0

You now have a floating point value to the tenths place as a PV. You could try to scale it 0-1000 and divide by 100 to get to two decimal places. In this case I don't think the 0 - 4095 limitation is really a "limitation" because your scaled EU range is small in comparison to the 0 - 4095 raw range. It's the integer math that is limiting you.

Try that trick and let us know how it goes.
 
I guess I should have mentioned this in my original post, but I have a scaled level value as a float, but I can't put that F8:x address into the PID PV. It gives an 'invalid data type' error, so I'm forced to use an integer.
 
Instead of 0-10, you could try scaling your PV from 0-1000. Be sure to search out any other references to the address used as the PV to make sure the code is corrected for the new "units x 100" integer.

With a PLC-5 or SLC, I typically try to use the default scaling for PID so that I maximize the available resolution of the analog modules.
 
Thank you all for the quick replies... Changing the scaling makes perfect sense now. I'm still curious to know if it's possible to have a floating address as a PV. I thought the manual said that as long as it's an 'Enhanced' PLC-5 all parameters can be floating points. I guess from the error message I got, it's safe to say the answer is no.
Thanks again
 

Similar Topics

I saw in a 24 V solenoid valve which has 3 wires (2 reds, 1 green); so 1 red is 24V power, another red is .... a common ??? or the green is the...
Replies
16
Views
4,271
Would using a PLC PID to control a motor of a loss in weight device where the motor is controlled through a Modbus or ethernet connection be a...
Replies
2
Views
3,229
I am doing a wire spooling application using an Automation Direct D-260 cpu, F2-8AD4DA-2 16 bit 8 ch in / 12 bit 4 ch out 0-10 vdc board. The...
Replies
10
Views
5,408
I am trying to figure out how to calculate the 'UNSCALED" Setpoint value based on operator entered PID setpoint. Not sure I have all the...
Replies
1
Views
3,818
Hi all, Got a quick question. Might be stupid and stright forward, but have to ask it. I have a loop being excecuted in a PLC5 PID loop, that...
Replies
2
Views
5,114
Back
Top Bottom