Best Practices for Migrating PID Control from PLC-5 to L81E: Insights on Configuration and Performance

Question:

I am currently developing a control system that incorporates seven PID (Proportional-Integral-Derivative) blocks in a PLC-5 and I am in the process of migrating it to an L81E controller. The conversion is nearly complete, but I still need to meticulously evaluate the PID loops. The initial logic configuration failed to correctly activate the PID instructions, with the exception of one block. These blocks are placed on unconditional rungs, and the loop update time is set to 0.2 seconds. Given that the PLC-5 scan time varied from 17 to 22 milliseconds, I've configured the new MAIN task to operate on a periodic schedule with a 20ms update rate. This should ideally result in PID performance in the new controller that closely mirrors the original. However, I am keen to ensure that these loops are programmed according to industry best practices. I am contemplating whether to relocate the PID loops to a distinct periodic task set for 200ms to align with their intended update rate, implement trigger timers configured for 200ms, modify the PID update rate to 20ms, or consider other options. I recognize that any of these adjustments may necessitate recalculating the PID gains. Prioritizing safety is crucial; if leaving the PID programming in its current state proves to be the most prudent approach, I will proceed accordingly. During the commissioning phase, we will cautiously ramp up the machinery and conduct extensive testing and tuning. I would appreciate any insights or recommendations you may have on this matter. Thank you!

Top Replies

Is the legacy PLC-5 system still operational and managing the control processes? Furthermore, can the new ControlLogix system effectively read messages from the PLC-5?

A few years ago, I encountered a system with challenges that are quite similar to the ones we face today. I opted for a conventional approach: the PID controllers kept their inconsistent Update Rate settings (sticking to 200 ms) while the actual execution rates were set at 20 ms. To address this, I assigned the PIDs to a dedicated Periodic Task, allowing me to adjust its execution rate later during the process of re-tuning the loops. Unfortunately, I never had the opportunity to do so. The response was, "They work? Fantastic, let’s ramp up production." If time had permitted, I would have pursued the strategy that Ron is suggesting: implementing Logix to gather process variables from the existing PLC-5 controller, enabling a comparison of outputs. This way, we could effectively test a newly re-tuned set of gains without modifying the control of the ongoing process. This approach not only enhances the system's performance but also allows for safer adjustments in real-time.

Following my contribution to this discussion, Facebook's advertising analytics system suggested that I read "An Idiot's Guide to the PID Algorithm." This recommendation seems to stem from my interests as reflected in my post.

Absolutely, the PLC-5 system remains operational, while our new setup is currently at our office for preparation and testing. I've finished programming the new system, as well as the updates to the Human-Machine Interface (HMI). I've significantly reorganized the setup, creating distinct routines for the inputs and outputs, allowing me to toggle a "simulate" bit for running simulation logic instead of the actual input/output (I/O). Although it's challenging to accurately model the equipment's real behavior, I've implemented a basic model to ensure that all components are accurately mapped to their corresponding HMI tags. The existing infrastructure involves two PLC-5/20 units connected via Remote Input/Output (RIO), with one handling all digital I/O and the other managing the analog inputs—resulting in a somewhat cluttered arrangement. The upgraded system will follow a similar structure, utilizing two L81E CPUs: one for digital processing and the other for analog tasks. Since this is a boiler control system, maintaining two processors is essential to meet our operational requirements; a single Logix CPU could easily manage the coding volume. Notably, my primary task executes in under 0.2 milliseconds per CPU, averaging around 0.120 milliseconds. The new system employs produced/consumed tags to replicate the tags once connected through RIO. I've dedicated considerable time tracing all the move instructions, Timer On Delay (TOD), and Frequency Response Delay (FRD) functions, as the analog processing was conducted with 12-bit Binary-Coded Decimal (BCD) cards. For the time being, I've retained the 0-4095 range for analog inputs but transitioned to REAL numbers in the new setup. This adjustment allows for improved resolution while maintaining the integrity of the Proportional-Integral-Derivative (PID) control code. Our strategy involves removing the old system and installing the new one, as configuring both for communication simultaneously does not appear feasible. Upon reviewing the PID parameters, it seems that the tuning might require refinement. Most PID controllers exhibit a proportional gain of either 0.1 or 0.2, while the integral gains vary, and none have a derivative component. Some control variables will interact in real-world conditions, and several PID control values are processed through a "function generator" before reaching their output terminals. The function generator consists of three subroutines utilizing lookup tables to convert the 0-4095 control values into percentages, apply a custom curve via a lookup table, and then revert to a 0-4095 integer. I preserved this logic, and the project migrator successfully integrated these values. To grasp their intended functionality, I plotted the lookup tables in Excel and created graphs for visualization. It seems the original programmer, a boiler technician, primarily used these tables for tuning combustion efficiency. The original code was rather chaotic, containing several outright errors that we've already rectified in the operational machine. It appeared that the initial programming team was still learning the PLC-5 architecture, leading to some confusion and significant inefficiencies in the implementation. For instance, one programmer converted a block from BCD to decimal using a single FAL command, then mistakenly employed CPT blocks with the original BCD addresses, introducing FRDs inconsistently. The PID values may have been adjusted when the system was first implemented, around 1995 per one drawing, but there have been no modifications in the last six years (the customer provided multiple backup copies to verify this). My coworker, who has extensive knowledge of this equipment, will assist me during the commissioning phase. His PLC expertise may not be as extensive as mine, so I aim to ensure we have a solid understanding before moving forward. We are tentatively scheduled for commissioning in late July, allowing ample time for installation and testing prior to returning to production. EDIT: The innovative idea of running both CPUs simultaneously to compare PID behaviors is excellent, and I will explore the possibility of securing floor space for this comparison. This approach would definitely be beneficial. Additionally, there is a Logix gateway connected to the DH+ network that might allow us to leverage some communications capacity. Though the DH+ network consists of eight nodes with RSView32 tags connected to four of them—resulting in reduced speed—we may be able to temporarily tap into the available bandwidth, which could yield practical advantages.

Ken Roach commented: After contributing to this discussion, Facebook's advertising algorithm suggested I check out a book titled "An Idiot's Guide to the PID Algorithm." Click to view... 😂 At just $7, I'm torn between whether it's a waste of paper or a fantastic deal!

It sounds like you're on the right track with the migration to the L81E, and your consideration of update rates is crucial for maintaining system performance. I would recommend that you keep the PID loops in a dedicated periodic task, especially if you want to maintain that 200ms update rate for better control. This approach can help isolate the PID processes and allow for more straightforward tuning without interference from other tasks. However, do keep in mind that you may need to recalibrate your PID gains to account for the changes in timing and ensure that you're maintaining stability. Thorough testing during commissioning will definitely give you the confidence you need, so ramping up gradually is a smart move. Good luck with your project!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

You must be a registered user to add a comment. If you've already registered,
sign in. Otherwise, register and sign in.

Frequently Asked Questions (FAQ)

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’