Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Servo / PWM settings

2025 Views - Created 17/12/2017

17/12/2017

Posted by:
martyn

martyn Avatar

Location:
UK

HI I'm very new to both python and servo control so apologies for stupid questions.

I have a ab servo zero board and I am trying to match the servo lib input values to my servo.

I have previously used the standard pwm lib direct to the raspberry GPIO pins and have successfully controlled the servo through the 180 degrees of movement but had problems with jitter and accuracy so I purchased an ab board.

With the ab library and the demo python scripts I am getting very in predictable results

the servo will only travel through approx 90 degrees.

When I run the demo_pwm.py script it is quite unpredictable in its results.

Is there a pattern for matching the specification of the servo to the timing and step params of the ab servo and pwm functions.

Thanks

martyn

17/12/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hi Martyn

The easiest way to find the limits for your servo is through trial and error.

Start with the set_low_limit(1.0) function reducing the value from 1.0 downwards in 0.1 increments. As you decrease the value the servo should move a bit further each time. Keep doing this until the servo stops moving any further and you will have your minimum limit.

Do the same thing with the set_high_limit(2.0) function increasing the value in 0.1 increments until you find the upper limit.

If you find there is any jitter when the sero is not moving then you can try changing the number of steps using the move(channel, position, steps=250) function. You can change the step's value between 0 and 4095 but a value between 100 and 500 will work best.

20/12/2017

Posted by:
martyn

martyn Avatar

Location:
UK

Thanks Andrew I'll have a play

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.