How to Connect and then Linearize the Potentiometer to PLC Interface

The potentiometer provides a convenient, user-friendly, method to adjust Programmable Logic Controller (PLC) parameters. The typical PLC accommodates the potentiometer via a 0 to 10 VDC analog input. Unfortunately, the interface is not as simple as we are led to believe. We must overcome linearity challenges as well as the natural limitations of the potentiometer.

This engineering brief presents two distinct methods to connect a potentiometer to the PLC. We explore a solution featuring a 10 VDC power supply and another featuring a resistive voltage divider. These practical methods are demonstrated using a Crouzet Millenium Slim PLC.

This document is part three in a series exploring the PLC potentiometer application. Please review the prerequisite documents:

  • Part 1 which describes the impact of PLC loading on the system’s linearity.

  • Part 2 describing the physical limitations of the potentiometer (Figure 1) and how to design a lookup table to linearize the system.

Figure 1: Close up of the Vishay potentiometer installed on a Schneider Electric 22 mm mount.

Tech Tip: Smaller PLCs in the Crouzet Millenium Slim class often feature dual-purpose digital and analog inputs with an input resistance in the 10 kΩ range. This complicates the design – especially linearity – as the PLC will load down the analog device. Be sure to review the prerequisite documents.

Use of a 10 VDC power supply

Since the PLC is designed for 10 VDC (max) analog input, it is natural to excite (drive) the potentiometer with a 10 VDC supply. The wiper will then swing from 0 to 10 VDC. This is the assumption we made in the previous articles.

The Wago Corporation 859-802 power supply as shown in Figures 2 and 3 is a representative example. This DIN-rail mounted power supply accepts 24 VDC and provides a non-isolated 10 VDC.

The wire connections are very simple. Connect the edge terminals of the potentiometer to 10 VDC and ground. The wiper is connected to the PLC’s analog input. As described in the previous articles, the PLC’s input resistance places a load on the potentiometer. For example, when set to 50% rotation, we expect 5 VDC on the wiper; instead, we measure 4.12 VDC due to the PLC’s 11.7 kΩ input resistance.

Figure 2: Image of the Crouzet PLC installed on a Phase Dock trainer. The 22 mm Schneider potentiometer is visible on the switch plate.

Figure 3: Close up image of the Wago 10 VDC power supply installed in the PLC trainer.

Tech Tip: Analog circuitry is sensitive to noise from a variety of sources including ground. The Wago power supply is non-isolated, implying that the 10 VDC output shares the same ground as the 24 VDC input. In some respects, it is like a high performance 7810 regulator (part of the 7805 family). Be mindful of the ground return paths to prevent ground loops. Ideally, the PLC, power supply return, and potentiometer’s ground leg would be connected using short a low-resistance central terminal point (star ground). Use of shielded or twisted wires may also help eliminate noise.

Use of a voltage divider

As an additional design challenge, we could potentially cost-optimize the potentiometer interface using resistors to eliminate the power supply. Here “cost optimize” may be a misnomer, as the technique requires two costly PLC analog input ports. Depending on your design and chosen PLC, the previously mentioned 10 VDC power supply may be less costly. It may also be easier to maintain and cause fewer headaches in the long run as the resistor-exclusive technique is a bit complex.

Figure 4 presents a viable resistor network to connect the potentiometer to the PLC using the primary 24 VDC as the excitation voltage. Observe:

  • The system is powered via the PLC primary 24 VDC source.

  • The 11.7 kΩ resistors (R4 and R5) represent PLC input channels 1 and 2.

  • Resistor R3 represents the 10 kΩ variable resistor.

  • R1 drops the PLC input channel 1 voltage to less than 10 VDC. For this design, a 30 VDC maximum power supply is assumed.

  • Resistor R2 “stiffens” the system by limiting the voltage excursions caused by the variable resistor R3 and R4 loading. Recognize that the Thévenin equivalent source resistance formed by R1 and R2 is low relative to the load of R4 and R5. Consequently, the voltage across the potentiometer is stabilized by resistor R2. This added current is a small price to pay when we consider that R1 would have otherwise been in the neighborhood of 25 kΩ.

Figure 4: Schematic of the resistor network to connect potentiometer R2 to the PLC. Note that R4 and R5 represent the input resistance of each PLC input channel.

Recognize that the resistor circuit is ratiometric. This implies that the critical signal information is contained in the ratio of input voltage for PLC analog inputs Ch1 and Ch2. Consequently, the system it is relatively immune to changes in the 24 VDC supply. We can demonstrate that the ratio is independent on supply voltage. Our design challenge is to constrain both inputs within the 0 to 10 VDC limitations of the PLC.

Tech Tip: The term ratiometric implies that a system’s voltage changes in direct proportion to the excitation (supply) voltage. For Figure 4, fluctuations of the 24 VDC supply voltage will result in linear ratiometric changes in both Ch1 and Ch2. The proportional change between the two signals is also maintained. Consequently, the system is immune to fluctuations in power supply voltage provided the PLC power supply voltages are met (datasheet specified as 22.8 to 28.8 VDC).

Linearization of the resistor network

The resistor network presents a software challenge, as every voltage moves as the potentiometer moves. Close inspection of Figure 4 shows that the R3 / R4 combination ranges from 10 kΩ to 5.5 kΩ depending on the position of R3’s wiper. This variable loading will change the PLC CH1 voltage as well as the CH2 voltage. Calculations show that the PLC Ch1 voltage will swing between 7.3 and 6.5 VDC when a 24 VDC supply is specified.

A spreadsheet was developed containing the brute force calculations for the Ch1 and Ch2 voltage based on potentiometer positions. The salient data is contained in the Ratio column which is calculated from the V Ch1 and V Ch2 data. The lookup table (columns labeled Input and Output) are generated by scaling up the ratio and copying the potentiometer position data. For example, the system detects a ratio of 0.149 between the measured Ch1 and Ch2 data, the PLC recognizes this as a potentiometer position of 20%. The corresponding “input” value of 15 is due to the non-linear loading described in the prerequisite articles.

Download spreadsheet here:

Divider.xlsx (39.7 KB)

Figure 5: Portion of spreadsheet used to calculate the ratiometric lookup table.

Tech Tip: A ratiometric system will cover up fluctuations in power supply voltage changes. However, it will not accommodate fast changes (spikes and noise). From a practical perspective, the two channels in featured design are read at different times as part of the natural PLC cycle scan. Reading in different time slots distorts these ratiometric readings. Adding a digital filter may be necessary to prevent nuisance variations that occur when a large load is toggled.

Figure 6 shows the Crouzet PLC program. Note that the potentiometer input (CH2 from Figure 4) is scaled from 0 to 30,000 and the potentiometer reference input (Ch1 from Figure 4) is scaled from 0 to 300. This scaling takes advantage of the full range of signed 16-bit integer system without the use of floating-point numbers.

Download Crouzet program here:

Analog_10_w_resistor.pcs (53.5 KB)

Figure 6: Crouzet function block demonstration program showing the scaling, division, and lookup table.

Results

Both methods yield reasonable performance within the limitations of the system:

  • The potentiometer’s natural dead band limits performance for small and large numbers. Dial setting between 0 to 0.75 and 9.25 to 10 are not usable.

  • The lookup tables do a good job linearizing the data. The PLC measurements are a good match for potentiometer dial settings between 0.75 to 9.25.

  • For the integer numbers scheme used in this article, the advantage goes to the 10 VDC power supply method as there are more bits associated with the calculation. The twin-channel resistor method is limited to dividing the potentiometer’s rotation into 100 segments. Performance between the two methods would be similar if floating-point numbers were used.

Tech Tip: This is a situation where Spinal Tap’s, “These go to 11” would have been useful. In all seriousness, a potentiometer with dial indicators -1 to 11 would ensure that setting 0 to 10 are linear. Perhaps Schneider Electric could investigate this design problem. An alternative, we could physically move the dial setting so that the hard mechanical stop is at -1 we then normalize the setting by adding 1 in the PLC code. Unfortunately, the resulting system will not be as loud, as “These go to 9.”

Failure modes and ease of repair

Performance for hard and soft failure modes requires additional consideration:

  • The lookup tables for both methods assume a 10 kΩ potentiometer. Replacement with a different valued unit will invalidate the lookup table.

  • Fluctuations in the 10 VDC power supply will immediately impact the performance.

  • Variations in the twin-channel method’s, 24 VDC supply are easily accommodated. However, noise in the 24 VDC supply will impact performance as the two channels are not sampled at the same time.

  • Both methods are susceptible to noise, requiring proper attention to grounding and shielding.

  • The twin-channel method is less intuitive. For instance, the inclusion of Resistor R2 in Figure 4 is not immediately obvious. Yet it has profound implications for the lookup table.

Parting thoughts

This potentiometer to PLC interface seemed like such as simple application. Not so, as it took three articles to describe the limitations and methods used to linearize the system so that internal PLC measurements align with the potentiometer’s dial markings.

  • Part 1 described the potentiometer loading associated with most PLCs though a Thévenin equivalent circuit lens.

  • Part 2 identified the physical deadband limitations of the potentiometer and the use of lookup tables to linearize the system.

  • Part 3 (this, our final article), shows how to power the potentiometer so that the output is compatible with the PLC’s 0 to 10 VDC analog input.

The inclusion of a 10 VDC power supply is a common and straightforward solution. The physical connections are easy to make and easy to troubleshoot. By contrast, the resistor divider method is more complex to wire, non-intuitive, and requires the use of two resource limited PLC analog inputs. From a system and total lifecycle perspective, the costs may be equal with a potential advantage to the 10 VDC supply when we include the inevitable troubleshooting time over the life of the equipment.

Which solution do you prefer from an initial cost as well as the total system lifecycle cost. Have you encountered other solutions? Also, please leave your comments and suggestions in the space below.

Let’s talk!

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.