Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Run range of servo with Adafruit PWM

yann2021
2021-04-10
2021-05-13
  • yann2021

    yann2021 - 2021-04-10

    Hello,

    Because I also want to use servos in my projects I buy an Adafruit 16-Channel PWM/Servo Bonnet for Raspberry Pi. I opened the sample project "Softmotion Servo Example" and I can see my servo running so far so good. I notice that the move limit of the servo are far under the mechanical limit (see attached file). Is there a way to increase the movement amplitude?
    Other question: I had a look into the project and seems to me sooo complicated just to move a model aircraft servo. Is there not a simple FB bloc or something like this ready to use?

    In advance many thanks for your replies.

     
  • yann2021

    yann2021 - 2021-04-15

    Hello,
    Nobody use this 16-Channel PWM/Servo from Adafruit?
    I tried to change the default value 60 to higer but this has no effects. Also when I try to lower the default value -60 without any effect in the run range.
    I also exposed the problem on the Adafruit forum:
    https://forums.adafruit.com/viewtopic.php?f=50&t=178077
    Adafuit told:
    "It's working for the standard 90deg servo range, so it generally does work and is supported. But using for angles beyond that is up to the software driver. In this case, you are using a Codesys driver, so the support for extended range use will have to come from there."
    So I ask here Codesys; is it supported to drive servo over 90Β° ?

    In advance many thanks for your reply.

     
  • eschwellinger

    eschwellinger - 2021-04-16

    as I remeber the same request have been in the old forum,
    I'm pretty sure there was a solution for it.
    https://forge.codesys.com/forge/talk/Runtime/thread/8981ce928a/?limit=25#4dfe

    snippet from there:
    because i had some problems with the standard Adafruit PWM and made my own version.
    Sometimes i need the PWMs and / or the servo control function.

    Use a Array[0..15] to send values from 0 - 100 for PWM function or 101 - 200 for servo control (1.01 to 2.00 ms Pulse)
    I added a accessible trim function for servo pulse finetuning.
    The State shows if the device is present and accessible.
    The IN shows the actual frequency register value.

    PCA9685.devdesc.xml [3.2 KiB]

    I2C_PCA9685.library [278.88 KiB]
    these drivers are open as source library - so you change whatever you need.

     

    Last edit: eschwellinger 2021-04-16

Log in to post a comment.