No announcement yet.

PWM sensor output to analog input

  • Filter
  • Time
  • Show
Clear All
new posts

  • PWM sensor output to analog input

    I plan on using the new PWM-out module on the Productivity 1000 with an H-bridge motor driver, but I do not see a corresponding PWM-in module for LIDAR sensors. What do you get when you put PWM sensor output on an analog input? If you get average current (or average voltage) that would make sense to me. Otherwise I could add a PWM-to-analog converter, but that is one more failure point in my design. Thanks

  • #2
    The PWM sends full voltage and no voltage in pulses at a specific frequency. Analog card is looking for voltage (or current) and will give you a digital count based on that voltage. So the PWM sent into an analog card would just show your a bunch of swings wildly as it tries to track going from full on to full off. Whether it will track this well enough or not depends on the update rate of the analog card.

    Now, you can probably use this to give you your average analog signal, by taking that analog input count in ladder and using an "average" instruction that is set for long enough that it will settle into the middle ground of those pulses. It is kinda "hacky" though. and speed changes would be delayed a bit while analog with filtering/averaging catches up. Then you will also need figure out a formula for taking the analog range and turning it into a number that represents your frequency so that you have something to feed to a PWM output.
    Last edited by MikeN; 11-08-2019, 12:21 PM.


    • #3
      Thanks MikeN, Your response gave me the exact detail i need to think about. I can't wait for a computed average, reaction speed is important. If I go with the LIDAR route I will find a PWM to analog converter and make sure the data is not delayed.