Adafruit 16-Channel 12-bit PWM/Servo Driver
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
It's been a while since I did anything with BASIC, but it looks like you have the right sequence for setting the frequency. But I don't see any initialization before that. Check out wire.begin() and the reset() function in the Adafruit PWMServoDriver library.
- alanm2
- Posts: 1
- Joined: Fri Oct 11, 2013 12:49 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
I am very new to the Adafruit site. I have just received two 16 Channel 12 bit PWM Servo drivers. I want to use these boards with a Raspberry Pi. I thought there would be some assembly instructions or schematic that would help with assembly, i can figure it out, but certainly not for beginners. Also is there Driver software availaible ? It sounds to me I have to do more online searching and build a power inteface board to control more powerful motors or servos.
Can someone put me on the right track here ?
Cheers Alan Mainwaring
Can someone put me on the right track here ?
Cheers Alan Mainwaring
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
The Pi version of the tutorial is here: http://learn.adafruit.com/adafruit-16-c ... spberry-pi
This tutorial is for use with the Arduino, but the assembly page is relevant : http://learn.adafruit.com/16-channel-pw ... r/assembly
This tutorial is for use with the Arduino, but the assembly page is relevant : http://learn.adafruit.com/16-channel-pw ... r/assembly
-
- Posts: 1
- Joined: Wed Dec 04, 2013 1:49 pm
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
I am interested in the amount of time it would take to update the positions of a bunch of servos using a bunch of these boards chained togeather (let's say 512 servos on 32 boards). Considering that each instance of setPWM() transmits a message 6 bytes long (one to address the board, one to address the channel, and 4 to write the start/stop info), and that an Arduino I2C generally operates at 100 kbit/sec (12500 byte/sec), it seems the maximum possible total update rate of a 512 servo system would be ~4Hz (=12500/6/512).
Is that a reflection of the real update rate I would get, or are there inherrient waits or other inefficiencies (in either the I2C protocol or Arduino transmit buffer) that would slow the system down beyond this? Would I be able to get to 16 Hz system update rate if I run with an I2C at 400 kbit/sec (assuming short engouh cables)?
Is that a reflection of the real update rate I would get, or are there inherrient waits or other inefficiencies (in either the I2C protocol or Arduino transmit buffer) that would slow the system down beyond this? Would I be able to get to 16 Hz system update rate if I run with an I2C at 400 kbit/sec (assuming short engouh cables)?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
Looking at the library code, I don't see any inherent delays in that. The Arduino i2c implementation is hardware supported and fairly efficient, so you should be able to get close to your theoretical calculation. And speeding up the i2c clock works quite well with the V2 motor shield which utilizes the same PCA9685 chip. Some have even reported success pushing the clock to 500 Kbit/sec.
That said, I don't believe a system of that scope has been tested.
That said, I don't believe a system of that scope has been tested.
- nafralet
- Posts: 3
- Joined: Thu Mar 06, 2014 11:14 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
Hi,
I'm new to this forum... and to electronics in general. I'm trying to get the servo driver to work with a bunch of servos, but it's not working out that well.
I have the servo driver hooked up to a pi. I also added a capacitor (4700uF 10v Electrolytic) and the driver is connected to a 6v 2.5A power adapter.
I was able to connect 6 analog servos (GWS03T/2BB/J) to the driver. This works and I'm able to address / drive the different servos.
My original intent was to use 9 digital servos (TowerPro MG995). Powering up the driver and then connecting the servos one by one, I could get the servos to work. Voltage stays at ~6v. However connecting the servos and the powering up the driver, the servos start to jitter and voltage drops to 1-2v. The servos are rated 100mA, but I noticed they could draw up to 300-500mA when I was plugging them in.
Anyone an idea what the best solution would be to get the servos to power up correctly? Even bigger cap?
I'm new to this forum... and to electronics in general. I'm trying to get the servo driver to work with a bunch of servos, but it's not working out that well.
I have the servo driver hooked up to a pi. I also added a capacitor (4700uF 10v Electrolytic) and the driver is connected to a 6v 2.5A power adapter.
I was able to connect 6 analog servos (GWS03T/2BB/J) to the driver. This works and I'm able to address / drive the different servos.
My original intent was to use 9 digital servos (TowerPro MG995). Powering up the driver and then connecting the servos one by one, I could get the servos to work. Voltage stays at ~6v. However connecting the servos and the powering up the driver, the servos start to jitter and voltage drops to 1-2v. The servos are rated 100mA, but I noticed they could draw up to 300-500mA when I was plugging them in.
Anyone an idea what the best solution would be to get the servos to power up correctly? Even bigger cap?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
300mA * 9 servos = 2.7A. Sounds like you are reaching the limits of your 2.5A power supply.The servos are rated 100mA, but I noticed they could draw up to 300-500mA
- nafralet
- Posts: 3
- Joined: Thu Mar 06, 2014 11:14 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
Hi,
Thank you for your reply.
Correct me if I'm wrong, but I thought the capacitor was there to help overcome the short surges in power demand when starting up servos?
Using the MG995s, I can have max 3-4 servos hooked up when powering the driver. Any more than that and they all start to jitter when applying power to the board.
Powering up the servo driver and then hooking up the MG995 servos one by one works. Is there any way to get the servo driver to apply power to the servos in sequence? Rather than fire them up all at once?
Thank you for your reply.
Correct me if I'm wrong, but I thought the capacitor was there to help overcome the short surges in power demand when starting up servos?
Using the MG995s, I can have max 3-4 servos hooked up when powering the driver. Any more than that and they all start to jitter when applying power to the board.
Powering up the servo driver and then hooking up the MG995 servos one by one works. Is there any way to get the servo driver to apply power to the servos in sequence? Rather than fire them up all at once?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
Yes. But if you are measuring a voltage drop down to 1-2v, you are not looking at a surge. That is a steady-state current draw and the power supply is clearly inadequate to handle it.I thought the capacitor was there to help overcome the short surges in power demand when starting up servos?
If there is no PWM signal on a channel, the servo will be idle. There will by some current draw from the circuitry - typically on the order of 10mA, but no power will go to the motors until there is a control signal on the line.Is there any way to get the servo driver to apply power to the servos in sequence? Rather than fire them up all at once?
To turn off the PWM to a channel, call setPWM(channel, 0, 0);
- nafralet
- Posts: 3
- Joined: Thu Mar 06, 2014 11:14 am
Re: Adafruit 16-Channel 12-bit PWM/Servo Driver
It helped to get the servos started... I'll get myself an amped up power supply. Thank you very much for your help. It has been very instructiveTo turn off the PWM to a channel, call setPWM(channel, 0, 0);
Please be positive and constructive with your questions and comments.