Just connect the potentiometer to the PLC!

Just connect the potentiometer to the PLC!

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.

Image of the PLC and potentiometer mounted on a small PLC trainer
Image of a Crouzet PLC and potentiometer mounted on a small PLC trainer

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.?

Hand drawn Thévenin equivalent circuit.
Hand drawn Thévenin equivalent circuit.

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).

?

Voltage divider circuit for the potentiometer to PLC connections.
Voltage divider circuit for the potentiometer to PLC connections.

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.

?

Image of the potentiometer set to 8.5
?

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.


????

要查看或添加评论,请登录

Aaron Dahlen的更多文章

  • What kind of schematic is this?

    What kind of schematic is this?

    That didn’t go as planned! Yesterday, I posted a challenge question featuring a reverse polarity protection circuit…

    4 条评论
  • To Program or Not to Program with HAL?

    To Program or Not to Program with HAL?

    Dear Embedded Engineer, You should ABSOLUTELY, MAYBE, or NEVER use a Hardware Abstraction Layer (HAL) when programming…

    36 条评论
  • Meet the Jellybeans: 1N4001 to 1N4007

    Meet the Jellybeans: 1N4001 to 1N4007

    What was it like being an electrical engineer in the 1960s? Perhaps it is like today with the emergence of AI. Like…

    23 条评论
  • Confessions of a Misguided Engineer: Miller Capacitance and Signal Generator Impedance

    Confessions of a Misguided Engineer: Miller Capacitance and Signal Generator Impedance

    A few days ago, I presented a common emitter amplifier with a variable resistor in the emitter branch. My intention was…

    12 条评论
  • Meet the 6KD6 Vacuum Tube: a victim of the silicon transistor.

    Meet the 6KD6 Vacuum Tube: a victim of the silicon transistor.

    On the DigiKey TechForum, I've been exploring Jellybean transistors. Many of the common silicon transistors were born…

    18 条评论
  • In defense of the Arduino: A Teaching Strategy for Higher Education.

    In defense of the Arduino: A Teaching Strategy for Higher Education.

    Introduction Recently I've read several LinkedIn posting describing the “higher education trap” associated with…

    15 条评论
  • Use of the AI for Active Learning

    Use of the AI for Active Learning

    Like a lecture passing from the instructor’s notes to the student’s notes without passing through the mind of either…

    2 条评论
  • Introduction

    Introduction

    This article contains a preview of my work conducted on the DigiKey TechForum. I'm always looking for new ideas and…

    2 条评论