PLC5 continuous PID conversion

efoote

Member
Join Date
Mar 2017
Location
Indiana
Posts
4
I'm working on a project to convert an old PLC5 processor to an L63.

Below is sample logic of one of the several PID controls from the conversion. In other places, the PID control has no permissive or timers and just executes every scan.

pid%20block_zps0gcqypyi.png


The loop update time is set to 1 second on each of these blocks, even though they're scanned continuously. I believe their process works as is, but without some sort of rework and re-tuning this conversion will mess everything up (since the scan times will be MUCH faster).

Do you think putting this logic in a periodic task with the same period as the average PLC5 scan time will work?
Do you have any tips or can you point me to tips for this sort of conversion?
 
You don't need any of the timing logic, just the PID instruction if you put it into a periodic task...

be sure to load the .UPD member of the PID tag with the time period of the periodic task....

The PIDs that are executing every scan will need re-tuning after conversion, I'm surprised they are working at all as they are...
 
You don't need any of the timing logic, just the PID instruction if you put it into a periodic task...
Unfortunately for me, the timing logic is existing from the old PLC5.

The PIDs that are executing every scan will need re-tuning after conversion,
That's what I'm afraid of.

I'm surprised they are working at all as they are...
Me too, but it's been like this for ~30 years.
 
Do you think putting this logic in a periodic task with the same period as the average PLC5 scan time will work?
If retuning the loops is unfeasible at this point, then your idea seems like a pretty good option. It certainly couldn't be worse than before- it would at least be more consistent.
 
I don't think that will work either.

What you *should* be doing with a PID loop is executing it for one scan at a fixed interval, with that fixed interval being programmed into the PID instruction.

The logic above is executing the PID loop every scan for half a second, and then waiting for half a second, and then repeating.

To make it function exactly the same in a CLX, you'd have to have a periodic task execute at the same rate that the existing PLC is executing, but then within that periodic task, enable the PID instruction for all scans within half a second, and then inhibit it for the remaining scans within that second. Your timer would have to be outside the periodic task.

Please, please don't do that. I mean, it would work, but it'd be up there with the ugliest things I've ever seen in a PLC...
 
I've seen this sort of thing done in the PLC-5 as well.

In my case, it was a maxed-out PLC-5/80 and scan times were around 150 milliseconds. The PID loops executed every scan, but they'd been tuned so that they worked pretty well, even though the loop update time was supposed to be 1000 ms.

The author of that logic clearly thought the PID was an edge-triggered instruction. It's not, and he probably fought the tuning bitterly.

The only thing for it is to re-tune the loops from scratch.
 
If retuning the loops is unfeasible at this point, then your idea seems like a pretty good option. It certainly couldn't be worse than before- it would at least be more consistent.
I don't know if it's unfeasible, but it's undesirable for me. I get to explain to my boss why it *used* to work and now it doesn't.

To make it function exactly the same in a CLX, you'd have to have a periodic task execute at the same rate that the existing PLC is executing, but then within that periodic task, enable the PID instruction for all scans within half a second, and then inhibit it for the remaining scans within that second. Your timer would have to be outside the periodic task.
I'll have to measure the scan rate on the PLC5, but if it's less than 100ms why would the the timer need to be outside the periodic task?

Please, please don't do that. I mean, it would work, but it'd be up there with the ugliest things I've ever seen in a PLC...
I'd say it'd be functionally equivalent to what exists now, but yes it'd be ugly.

The only thing for it is to re-tune the loops from scratch.
That's what I was afraid of.

Alright, thanks all for the advice. It seems I'll get to learn this particular process under (out of!) control intimately more that I ever wanted to. I'll also follow up here once the job is done with any more learnings or if I run into other major problems. I appreciate it.
 
According to this manual on page 14-11
http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1785-rm001_-en-p.pdf

If you use a PD file, it executes every scan, but if you use an N file, it is rising edge triggered.

In your example though, you are using a PD file, so it will execute as per ASF's description.

I am not sure if in the conversion algorithm, whether it has converted your N file PID loods to PD file PID loops by accident/on purpoise.

[AB employee riding a porpoise.gif]
 
I am not sure if in the conversion algorithm, whether it has converted your N file PID loods to PD file PID loops by accident/on purpoise.

[AB employee riding a porpoise.gif]

While that would not have surprised me, the original PLC5 uses PD files. :(
 
I don't know if it's unfeasible, but it's undesirable for me. I get to explain to my boss why it *used* to work and now it doesn't.
"because the original programmer did a very poor job of it, didn't understand how it worked, and eventually found a way to make it function acceptably in exactly that configuration but no other" would be where I'd start ;)

I'll have to measure the scan rate on the PLC5, but if it's less than 100ms why would the the timer need to be outside the periodic task?
Thinking about it a little more, I guess it wouldn't - but just keep in mind that the resolution on your timer if you stick it in a 100ms periodic task will be fairly coarse. I mean, given what's currently there I suppose it would fit right in, but...

I'd say it'd be functionally equivalent to what exists now, but yes it'd be ugly.
My eyes are watering just thinking about it :cry:
 

Similar Topics

I am using the following formula and I am getting error, Invalid Expression - too many closing parenthesis. when i copy the formula to notepad or...
Replies
4
Views
145
Preface: Kinda long, so I made section titles Intro: I just want to see if anyone here has seen anything similar. A PLC5-40 series C enhanced...
Replies
3
Views
364
Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
508
Hello all, I am seeing this behaviour where an integer file (N46:33), has an integer in binary (11110) which is 30 in decimal. I did a...
Replies
7
Views
513
Back
Top Bottom