go away spammer

Author Topic: Axon PWM / Servo question  (Read 1684 times)

0 Members and 1 Guest are viewing this topic.

Offline ZondartulTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Axon PWM / Servo question
« on: December 08, 2010, 04:48:54 AM »
Hey, this is probably a silly question, but the Axon I page says it can control up to 29 servos... yet it can only support 9 PWM channels.

I am confused. Isn't controlling a servo = constantly supplying a PWM signal, or else it will go limp? Does it mean out of 29, only 9 can be on at once, or does it mean there are actually 29 PWM channels?

Can I use Axon to change the angle for 24-27 servos simultaneously?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Axon PWM / Servo question
« Reply #1 on: December 08, 2010, 02:20:49 PM »
The number of hardware PWM channels is fixed by the ATMega640 (and not all of them have got header pins on the Axon - unlike the Axon II).

The reference to 29 comes about because of the number of header pins that also provide the battery voltage - ie they are 'potential' pins that can be used for servos.

How do you drive a greater number of servos? Well - you simulate the PWM in software by using timers to generate pulses on whatever pins you want.

If you are daunted by writing the code to do that then WebbotLib (http://webbot.org.uk) is a library that will do it for you.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Axon PWM / Servo question
« Reply #2 on: December 08, 2010, 03:37:06 PM »
What Webbot is eluding to is there is Software-based PWM, and Hardware-based PWM.

In hardware PWM, it's a 'set and forget' type of thing. In this sense it is better, but there are only a small number of hardware PWM pins (as you have realized).

In software PWM, the software pulses a pin really fast - just like code to turn a LED on and off. The disadvantage is that this takes up some processing power, but you can use any pin to do this.

This is why the Axon II has 2x as many hardware pins.

The WebbotLib Project Designer lets you use one or the other, or both at the same time, and is really easy to set up.


Get Your Ad Here