In various groups and blogs I peruse on here, there's been talk about I2C control of servos (as opposed to standard PWM). This certainly solves several problems, as it allows one I/O port (I2C) to service over a hundred servos with ease. With some built-in intelligence, the servo itself can take care of interpreting and following commands without the need for continual updates from the system (i.e., true asynchronous operation). In addition, servo power lines are kept separate from the autopilot board, thus eliminating the possibility of overheating board traces due to excessive current draw (a stack of 8 servos, especially digital ones, can easily exceed the amperage rating of the traces and wiring used in some autopilot boards). The one drawback to I2C control... if one servo's electronics fails and "latches" the bus, the entire network is toast. However, that possibility can be mitigated through an isolation network built onto the servo control board.

Coincidentally, today I read a message on the UAV Dev Group about an open source servo project called (not surprisingly) OpenServo*. Among other things, they offer complete ready-to-go boards that fit inside some standard servos and convert them to I2C. Here's a list of features, directly from their page:

  • High performance AVR 8-bit microcontroller
  • Compact H-Bridge with high performance MOSFETs
  • Precision control over servo position and speed
  • I2C/TWI based interface for control and feedback
  • Feedback of position, speed, voltage and power
  • Advanced curve based motion profile support
  • EEPROM storage of servo configuration information
  • Software written in C using free development tools
  • I2C/TWI bootloader and GUI programmer

I thought I'd mention it here, since there seem to be people from several diverse groups interested in this (I2C servo control). Price is $14.95 from SparkFun Electronics.

*Credit to Peter Holands of UAV Dev Group for spotting this.

Views: 2101

Tags: I2C, control, servo


3D Robotics
Comment by Jordi Muñoz on May 6, 2010 at 1:10pm
The problem with APM will be the saturation of the I2C, everybody now wants to hook everything on the poor i2c port and is understandable, is easy to use and simple to interface.

"itself can take care of interpreting and following commands without the need for continual updates from the system", really? The PWM outputs of the atmega uses independent (and free running) timers that don't affect the CPU performance at all, you only access a registry to change the servo position, using just two clock cycles to do that, with I2C you will require a lot more than that.


2-You can always (and is 100% recommended) use an external supply for the servos, coming from the motor controller or another UBEC system. Then APM can also use those 5V to run. The build in 5V regulator is just for flexibility. The traces are huge enough to handle big servos.

3-That will also increase the size and the price overall of the system....

4-The unit from SF you mention, only works for some servo sizes.... and now imagine paying $15 extra dlls per servo! That's expensive!!
Comment by Lew Payne on May 6, 2010 at 1:50pm
Hello Jordi... while I understand what you're saying, the world does not revolve around the atmega. A cursory inspection of some of the prior (abandoned) projects on here reveals folks that ran into servo timing and control problems. That's what happens when you choose the uController before defining application requirements.

5 - I agree that you can and should use an external supply line for feeding auxiliary (non-navigational) servos. I don't think the typical hobbyist stops to calculate maximum surge current when adding "just one more" servo to his/her existing system. Therefore, an external line would save us from having to worry about it, period.

6 -Price is relative. What you may find expensive (and spend hours doing another way), I may find inexpensive relative to the convenience it provides me.

7 1/4 - Yes, so far, it does only work on some servos. Just as, at one time, the many autopilot projects on here were only theoretical and didn't work on any vehicle. Give it time...

The purpose of my post is to inform others of the options that are now available. Thank you for pointing out that atmega users really don't need it. Unless, of course, they run out of I/O pins or board real estate from trying to fit 112 standard servo header pins on it. :)
Comment by mook on May 6, 2010 at 2:26pm
just reuse

as an i2c to PPM and you're set. $24 for 8 channels vs $14 for 1 channel.
Comment by Jack Crossfire on May 6, 2010 at 2:53pm
Long considered it for improving the stability of a flybarless TRex-450. The higher update rate would have had a huge impact.
Comment by Carlito Oliveira on May 6, 2010 at 3:19pm
I2C is very sensitive to noise, If I were to build a servo I'd use CAN bus.
Even the own power lines of the servo could cause interference in long cables.

3D Robotics
Comment by Jordi Muñoz on May 6, 2010 at 3:32pm
CAN bus would be great for all this...

Developer
Comment by Sandro Benigno on May 7, 2010 at 1:37am
OK... I'm sure that i2c by itself won't solve everything... But in conjunction with another aspects it can be interesting. For example, it's very significant the use of an i2c layer instead of direct PWM for make ESCs more responsive for all lines of a quadrotor. But i2c isn't the hero. The real gain is achieved by two other things: Fast PWM with 16bit resolution. The i2c is only a comfortable way to turn the communication more easy and intuitive on code.

For servos... I saw only one point that is interesting in that kind of implementation. It will need more clock cycles... OK. It's really the true. BUT the mostly part of ICs have a limited number of channels that provides PWM output at 16bit. Atmega328 have only "timer/counter1" in conjunction with "OC1A/OC1B" to provides two 16bits PWM output channel. So, if you need a way to achieve more channels by using an external board... it's understandable. By other hand... If you make a 12c board for control a servo and you DON'T choose the best timer channel for that job, loosing the 65536 steps on counter and the same steps at the level set of the output comparator for construct the PWM signal... so, you really wasted all your precious time and money. :/

Atmega1280 (used on ArduPilot Mega) have timers 1,3,4 and 5 for it with a lot of output comparators. So, in that case... I think that rarely you will need this kind of trick.
Comment by Guido Armaris on May 7, 2010 at 2:00am
In noisy environment, I used LVDS driver for a long SPI line clocked at 100 MHz.
Maybe it could work for I2C ?, LVDS driver are very common and low cost.

Developer
Comment by Sandro Benigno on May 7, 2010 at 3:59am
@mook... It's a great PWM to PPM product. BUT, if we try to reuse it for that other purpose... we will find a lot of trouble.
-First issue: the i2c pins (PC4 and PC5) are disconnected.
-Second: it have PD0 to PD7 exposed on signal pins. Only PD3, PD5 and PD6 are PWM capable.
-Third: why would we do that, if the best output are not exposed on the signal pins? (remember... 16bit PWM is only disposable on PB1 and PB2). So... I see no sense in trying to do that.
Comment by Lew Payne on May 7, 2010 at 10:38am
Nice catch, Sandro! Thanks for looking at the specs and noticing this.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service