The lookup table provides a convenient way of mapping one domain to another. They are especially useful for “straightening out” a nonlinear system. As an example, consider part 1 of this series. It describes the non-linear response of a 10 kΩ potentiometer when loaded by the Crouzet Millenium Slim’s 11.7 kΩ input impedance. It’s a subtle problem where the potentiometer’s physical markings do not align with the system’s measured voltage.
Figure 1: Image of the Crouzet PLC installed on a Phase Dock trainer. The 22 mm Schneider potentiometer is visible on the switch plate.
Tech Tip: Both the lookup table and equation are effective methods used to linearize a system. The lookup table may have a slight advantage in terms of accuracy. It may also have a slight advantage from the maintenance perspective as people may perceive it as the simpler solution. Either way, the designer must understand the data and documents the design.
Understand the nonlinear data
The first step to linearizing a system is to understand the data. This article provides a brief introduction to the problem. It is focused through the lens of the Thévenin equivalent voltage and resistance which change as the potentiometer changes position.
The previous article assumes that resistance changes linearly with rotational position. While this is true for the chosen Schneider Electric XB4BD912R10K potentiometer, it is incomplete. To understand, we must look deeper and recognize that the Schneider part incorporates a Vishay P11S series potentiometer.
The green line in Figure 2 highlights the actual response of the linear taper potentiometer Vishay datasheet. We observe that the resistance is a linear function as the potentiometer travels through 270 of its 300-degree rotation. There is a dead band where resistance does not change in the first or last 15 degrees of travel.
Figure 2: The green line presents the actual response of the linear potentiometer while the red line shows our erroneous full-range assumption.
A classic mistake is to assume a linear change in resistance over the full 300 degrees of travel as represented by the red line. This is a significant error when compared to the true green line. We see that the lines cross (zero error) at the potentiometer’s midpoint. The error grows increasingly large as we approach the ends. We end up with the same problem as mentioned in the previous article. Specifically, our potentiometer markings do not match the measured voltage at the potentiometer’s extremes.
Spreadsheet to the rescue.
As described in Part 1, we can use Thévenin equivalent circuit calculations to identify the potentiometer’s output voltage with consideration of the PLC’s loading effect. This yields the erroneous red line shown in Figure 2.
Shifting the data to the proper green line isn’t particularly difficult, we recognize the potentiometer’s deadband edges and adjust the mapping accordingly by changing our 0% to 100% frame to a 5% to 95% rotational frame. An example is included in the spreadsheet as shown in Figure 3.
Download here:
Table.xlsx (39.8 KB)
Figure 3: Portion of spreadsheet used to construct the lookup table.
Tech Tip: The spreadsheet is written for the integer math of the Crouzet PLC. The physical 0 to 10 VDC input is mapped to a 1 to 1000 representation. This power-of-ten scaling technique allows us to retain a level of resolution without resorting to floating point numbers.
How is the lookup table used?
The spreadsheet is constructed to predict the measured PLC value for a given potentiometer position. For example, setting the 10 kΩ potentiometer to its 50% position yields physical voltage of 4.12 VDC which is then scaled up to 412 inside the PLC.
To use the lookup table, we reverse the process. In this example, the value of 412 is mapped to 500. The result is that the PLC properly maps a 5 to 95% physical rotation to a 1 to 1000 scaled value. Note that this scaling factor is used to eliminate reliance on floating-point numbers. The input and output table columns are on the right of Figure 3.
Figure 4: Representative Crouzet PLC program (function block with textual connections). The input values are scaled from 0 to 1000 and then linearized using the Y = F(X) block shown in the lower left corner.
Tech Tip: Lookup tables such as the Crouzet Y = F(X) Transfer Function block shown in Figure 4 (lower left) do not require all 1000 values. Instead, they perform a linear interpolation using the two closest values in the table. In this example, 100 lines are sufficient for the entire 0 to 1000 scaled range.
Empirical verification
After the PLC is programmed, we can verify the validity of the lookup table by setting the potentiometer and then verifying the PLC. The system response was favorable showing a good match for dial settings between 1 and 9. Errors in the lowest and highest dial settings are a natural result on the potentiometer’s construction.
Tech Tip: The errors about zero may be undesirable for your application. While not an ideal solution, we could physically move the potentiometer to an off-scale 1 to 9 position. The PLC could then “subtract 1” placing the new zero in what was previously the dial 1 position. This practical solution assumes we do not need to reach dial position 10.
Parting thoughts
The linear potentiometer seems like such a simple application for an industrial control system. Now that we are two articles deep, we see that it is very deceptive. Stay tuned as we explore how to accommodate the PLC’s 10 VDC input within a 24 VDC system.
Looking forward to the continued conversation. Please leave your comments and suggestions in the space below.
Best wishes,
APDahlen
Related information
Please follow these links to related and useful information:
About this author
Aaron Dahlen, LCDR USCG (Ret.), serves as an application engineer at DigiKey. He has a unique electronics and automation foundation built over a 27-year military career as a technician and engineer which was further enhanced by 12 years of teaching (interwoven). With an MSEE degree from Minnesota State University, Mankato, Dahlen has taught in an ABET-accredited EE program, served as the program coordinator for an EET program, and taught component-level repair to military electronics technicians. Dahlen has returned to his Northern Minnesota home and thoroughly enjoys researching and writing articles such as this.