Softmotion Servo Example not working

allen00se
2016-09-01
2016-10-02
  • allen00se - 2016-09-01

    Hello all,
    I am using the Softmotion Servo example as instructed but I cannot get any more than the 60 to -60 degrees of motion to work. I try to set the servo config to 90 to -90 but it doesn't work. I have verified that these servos can actually move 90 to -90 with python PWM code.

    Thanks in advance.

     
  • allen00se - 2016-09-07

    Anyone else out there able to get this example to work properly? Is there any other way to use PWM with CodeSys? I really only need to set my server to 2 different positions and don't really need any of the soft motion functionality.

     
  • LukaszBien - 2016-09-27

    hello,
    I might suggest to modify SM3_Drive_Servo library.
    This library use block from library I2C_AdafruitPWM.
    In declaration area in function block block 'AXIS_REF_SERVO' you can find:

    VAR pAdafruitPWM: POINTER TO PWM.AdafruitPWM; usiAxisIndex: USINT; lrMinPos, lrMaxPos: LREAL; lrMinPwm: LREAL := 1; lrMaxPwm: LREAL := 2; lrInitPos: LREAL;END_VAR

    Try to change value in lrMinPwm to e.g 0.8 and lrMaxPwm to 2.2 ( you will need to find your own values probably).
    after this save this lib and install and it should give you (hopefully) wider range.

     
  • allen00se - 2016-09-27

    LukaszBien hat geschrieben:
    hello,
    I might suggest to modify SM3_Drive_Servo library.
    This library use block from library I2C_AdafruitPWM.
    In declaration area in function block block 'AXIS_REF_SERVO' you can find:
    Try to change value in lrMinPwm to e.g 0.8 and lrMaxPwm to 2.2 ( you will need to find your own values probably).
    after this save this lib and install and it should give you (hopefully) wider range.

    Thanks for the tip, I will try it out.

     
  • kelad - 2016-10-02

    Please let me know your findings. Thanks

     

Log in to post a comment.