Just connect the potentiometer to the PLC!
Aaron Dahlen
DigiKey TechForum writer | MSEE with technician foundation | Instructor | Coast Guard Veteran
A blog post from a @Digikey Applications Engineer.
It seemed like a simple task
Pull a 10 VDC power supply and a 10 k? potentiometer from DigiKey stock. Wire them to the PLC and then write an article. We should be done by noon.
Not even close! The actual task of linearizing the system was much harder.
PLC Loading causes nonlinearities
An ideal potentiometer acts as a voltage divider providing a linear relationship between output voltage and rotational position. Here the term “ideal” implies that the potentiometer has no load. Just like a low pass filter, things fall apart when the output is loaded. In this application, the dial marking did not match the measured voltage.
The potentiometer is not linear over its full travel
To make things worse, the potentiometer is not linear over its full range. Instead, there are dead spots on either side. Given dials setting from 0 to 10, there are natural dead spots from 0 to 0.5 and 9.5 to 10.
That’s why PLCs include lookup tables to straighten out the nonlinearities.?
Battling spreadsheets
As an applications engineer, it’s my job to help you integrate components such at the PLC and the potentiometer. We could have said pragmatic and live with the nonlinear situation. However, that would not have solved the problem. Instead, I dusted off Thévenin and settled in for a learning opportunity.?
The technique wasn’t too hard. I worked a few examples with pencil and paper. Then, I moved to the spreadsheet to generalize the problem. As an intermediate step, I had a 100-line table identifying the measured voltage for each potentiometer position. The PLC lookup table was easily constructed by reversing the process – for every input voltage we can determine the actual position.
Simplifying the hardware at the expense of mathematics
To complete the exercise, I challenged myself to eliminate the 10 VDC supply and retain the precision. That turned out to a real challenge that required two PLC analog inputs. After more pencil and paper exercises, and a trip to a circuit simulator, I wrestled to produce another spreadsheet. The math is ugly, but the hardware is simple and inexpensive (provided we have a spare analog input).
?
Success
The PLC registers now match the potentiometers dial markings. And we have a better understanding of the system’s limitation, especially at the extreme ends of travel.
?
Further reading
We can continue this journey on the @DigiKey TechForum:
Next steps
This would make a good lab. Students are challenged to apply those EE-101 lessons in a concrete easy to understand real-world problem. The lab is easy to refresh as the number change for every PLC and for changes in potentiometer resistance.
I hope you found this material is useful. Do you have any tips or suggestions for the hardware or software implementation?
Sincerely,
Aaron
Aaron Dahlen, LCDR USCG (Ret.), DigiKey application engineer.
????