• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Using PWM Output from Raspberry

    UniPi 1 - First Generation
    2
    5
    68
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      juergschwarz last edited by

      Im am using openplc with unipi 1.1 and raspberry 3. The unipi output A0 is only analog 0-10V and not a real digital PWM signal.

      To control a servo i need a real digital PWM signal. How is it possible to use this in parallel to unipi?

      J 1 Reply Last reply Reply Quote 0
      • J
        juergschwarz @juergschwarz last edited by

        Ok now i send a pic and a video

        Bildschirmfoto von 2022-01-17 16-17-33.png

        And here the video

        https://link.eu1.storjshare.io/jwsnlnnvc4qlkvuxqltk7kygvoaq/freigabenallgemein%2FVID_20220117_161837.mp4

        As can be seen, the frequency changes rather than the length of the period

        Martin Kudláček 1 Reply Last reply Reply Quote 0
        • Martin Kudláček
          Martin Kudláček @juergschwarz last edited by

          Hello @juergschwarz,
          none of the outputs are capable of being drived by PWM signal. The analog output has a filter + amplifier to create smooth(ish) output. This cannot be bypassed.

          Other outputs are the relay outputs - and if your frequency is not in tens of seconds (or better in minutes), then I would not advise to use PWM to drive them.

          You can try using some I2C expander connected to the external I2C bus.

          Best regards,
          Martin

          J 1 Reply Last reply Reply Quote 0
          • J
            juergschwarz @Martin Kudláček last edited by

            @Martin-Kudláček said in Using PWM Output from Raspberry:

            Hello @juergschwarz,
            none of the outputs are capable of being drived by PWM signal. The analog output has a filter + amplifier to create smooth(ish) output. This cannot be bypassed.

            Other outputs are the relay outputs - and if your frequency is not in tens of seconds (or better in minutes), then I would not advise to use PWM to drive them.

            You can try using some I2C expander connected to the external I2C bus.

            Best regards,
            Martin

            Ok i forgot this info: I try to use the raspberry output %QW0 separately to generate this PWM signal and not the A0 from unipi. I my video you can see the output of %QW0.

            J 1 Reply Last reply Reply Quote 0
            • J
              juergschwarz @juergschwarz last edited by

              @juergschwarz Ok it works. had to change the position in raspberry.cpp to the end of
              void initializehardware()

              and the Initial values higher (4000 and 6000)

              Thanks

              1 Reply Last reply Reply Quote 0
              • Locked by  A AVsetula 
              • First post
                Last post