Software > Software

Project Designer error message when trying to use all AXON2 PMW + software

<< < (2/3) > >>

Webbot:
Without a project file its hard to comment as I can't see: what's going or the other hardware you've got configured as well.

happy_hippo:
Here is the project file. When I open it, I get red triangles next to servo banks :(

Webbot:

--- Quote from: happy_hippo on August 30, 2013, 06:23:35 PM ---Here is the project file. When I open it, I get red triangles next to servo banks :(

--- End quote ---

Yep - what you are seeing is as expected. Here's why:-
Look at H/W pwm 'bank2' this uses hardware pwm on B7,B6,B5. These are all Timer1 pwm outputs ie OC1C, OC1B, OC1A - where OC1x refers to Timer 1.

Now look at your software PWM 'bank1' by double clicking on it:- you will see the 'Timer' drop down is set to Timer1.

ie you are trying to use Timer1 to do 3 x Hardware PWM on bank2 but then you are also trying to use Timer1 to control software PWM on bank1. It can't do two things at once! Thats why got the triangles.

Your two hardware banks: bank2 and bank3 - use timers 1,3,4 and 5. The 'clock' device uses timer 0.
So the only available timer for your software bank1 is Timer 2 - which is only an 8 bit timer and so can't be used.

So to progress:-use timers 3, 4, 5 for 9 x hardware PWM. Keep the clock on an 8 bit timer (0 or 2). and then use the remaining 16 bit timer 1 for software PWM and put remaining servos there. If you need 'more' hardware PWM then I suggest you look into the multiplexer solution by adding an external chip. (probably cheaper than servo controller boards).


Webbot:
If anyone is wondering why an 8 bit timer is disallowed then:

* Assume the servo responds to pulses from 1.5ms to 2.5ms
* This gives a usable range of 1ms from a max of 2.5ms
* An 8 bit timer (0 to 255) will therefore have: 256 * (1 / 2.5) = about 10 different positions it can be set to - which isn't very useful ie 5 positions clockwise and 5 positions anti-clockwise. Or for most servos represents a swing of about 25% per increment
Numbers are approximate, and will vary per servo, but hopefully explains the thinking as to why 8 bit timers aren't great for servo h/w pwm.

happy_hippo:
Thanks a lot Webbot, that clarifies a lot and that's what I actually had to use to overcome the problem. It's just on forums there were messages where people claimed to be using >9 hardware pwm servos.

Some quick questions, does it matter how the servos are divided into banks? Should I make as few banks as possible or as many as possible? Is it good to keep the number of servos in each bank equal?

Thanks  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version