Servo speed on 16 channel servo bonnet

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
Kingbob
 
Posts: 40
Joined: Tue Jul 08, 2014 11:47 pm

Servo speed on 16 channel servo bonnet

Post by Kingbob »

I have the 16 channel Servo/PWN Bonnet for a Pi, and its working controlling the servos, but i need to slow some of them down. They're just moving way too fast.

Can the speed of movement be altered?
Rather than telling it to move direct from 0deg to 180deg for example, i tried a loop moving it in increments with a small delay, but that just ends up being really jerky movement. I need a nice slow movement.

Thanks

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo speed on 16 channel servo bonnet

Post by adafruit_support_bill »

Servo seek speed is controlled by the internal circuitry of the servo. Some of the more expensive digital servos allow you to tune that behavior. But on most hobby-grade RC servos it is fixed. In order to control seek speed on common RC servos, you need to use incremental moves.

User avatar
Kingbob
 
Posts: 40
Joined: Tue Jul 08, 2014 11:47 pm

Re: Servo speed on 16 channel servo bonnet

Post by Kingbob »

OK, so i cant directly control the speed, but i should be able to control the PWM waveform, similar to how James Bruton does it in this video:
https://youtu.be/jsXolwJskKM?t=314

Or another example in python on a pi using the pwm pin here:
https://youtu.be/_fdwE4EznYo?t=691

This gives a slow start/stop to the movement, which will do what i want. I believe i can repproduce this in python on the pi, but how do i address the PWM port on the bonnet over i2c?

Basically this will control the aplitude of the pwn signal, at the moment the adafruit servo library only controls the length of the pulse, not the amplitude.

Thanks

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo speed on 16 channel servo bonnet

Post by adafruit_support_bill »

James Bruton is not modifying the PWM waveform. He is adding some smoothing to the incremental moves so that the servos decelerate as they approach the final position.

James Bruton's code is a refinement of the servo code from my Arduino multitasking tutorial:
https://learn.adafruit.com/multi-taskin ... lean-sweep

There is a CircuitPython version of the servo multitasking code here:
https://learn.adafruit.com/multi-taskin ... hon/servos

User avatar
Kingbob
 
Posts: 40
Joined: Tue Jul 08, 2014 11:47 pm

Re: Servo speed on 16 channel servo bonnet

Post by Kingbob »

I think that will give me the effect i'm looking for. But how do i address the PWM port on the bonnet over i2c?
The examples use a PWM pin on the GPIO.

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo speed on 16 channel servo bonnet

Post by adafruit_support_bill »

The CircuitPython ServoKit library can be used to address the PWM ports on the bonnet:
https://learn.adafruit.com/adafruit-16- ... on-library

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”