Society of Robots - Robot Forum
Software => Software => Topic started by: mstacho on January 24, 2011, 11:28:46 AM
-
Just out of curiosity, if I use one of the PWM channels on the axon, what's the duty cycle, in seconds? I ask only because I may have to do some software PWM'ing and I don't want to mix duty cycles...
MIKE
-
Duty cycle is measure in percent of the PWM period not in time (seconds).
What device do you need to control with PWM?
What frequency or period do you require?
-
Sorry, I meant PWM period. I calculate the duty cycle on my own as a percentage of the period as you say, but once I know what percentage I want (I evaluate it as a PD controller) I am now just multiplying by the maximum integer, which in my case is 255, which represents one full period for the 8-bit PWM. I want to know what 255 corresponds to in seconds.
As for the device, it's just a bunch of DC motors. I can't use servos because I need both position and force control, so it's PWM for me :-)
MIKE
-
You should use WebbotLib. My original Axon library is now obsolete.
http://webbot.org.uk/iPoint/37.page (http://webbot.org.uk/iPoint/37.page)
You can set your period to be just about whatever you want, although resolution is limited to the 16 bit timers on a 16MHz processor.
-
You should use WebbotLib. My original Axon library is now obsolete.
http://webbot.org.uk/iPoint/37.page (http://webbot.org.uk/iPoint/37.page)
You can set your period to be just about whatever you want, although resolution is limited to the 16 bit timers on a 16MHz processor.
Servo software PWM requires 16 bit timers - but general pwm motor control can be done in WebbotLib using 8 bit timers.