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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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.
Thanks for the tip, I will try it out.
Please let me know your findings. Thanks