Simultaneous pwm and servo commands

rjconway

New Member
Hi in biulding a small tracked rover robot (40x) I was hoping I could slow the bot down (pwm) and also get the servo to move. I understand servo and pwm use the same internal timer ?

What about the x2 chips, If pwm is really hardware based can I use the hardware pwm and servo commands at the same time ?

rob
 

slimplynth

Senior Member
I was impressed with my servo's running/operating speed at 32MHz, from a 20X2.

Need my bot to be as small as possible while having as many sensors crammed in as possible :D (typical, for me - "moon on a stick mentality")

Was planning on waiting for the 18M2 to arrive and use that to control the motors.

Separate picaxe chips seems the way forward to me. Otherwise it's...

Start motors/stop/check sensors/move servo/start/stop/check...

This weekend hoping to get background serial sorted to assist in this.

Edit: if you can afford a couple of 20X2's, they'd fit in almost the same footprint as your 40X. Am sure you'd get a much more impressive result by splitting up the various tasks between the chips. The software/code might be slightly more difficult but that's half the fun.
 
Last edited:

BeanieBots

Moderator
You could use pulsout for the servos and PWMout for motor speed control without having a conflict. It can be a little fiddly to keep a good 20mS frame rate but very few servos care if it's a bit out and most are quite happy even if it's wildly out:)
 

rjconway

New Member
reading the latest manual it seems hpwm does not state that I cannot use a servo command at the same time. Maybe I'll just have to buy a 40x2 and try it
 

slimplynth

Senior Member
Thanks Ec :) I'm putting my confusion down to the hot weather - i should have remembered my own skills with
Code:
[confusion]... site:www.picaxeforum.co.uk
Just finished watching England lose to Germany, don't think now is a good time for tinkering with Mecanno-Picaxe-bot... but will read later though, Cheers again ;)
 
Last edited:

Wrenow

Senior Member
And, of course, if you use an ESC (electronic speed controller) from the hobby store, you can just send it servo pulses to control your motors.

And update, Vex robotics has brought out their ESC again in a new and improved version that handles up to 3A (the old one was 1A) - and it is still only USD$10 for a fwds/reverse ESC.

Cheers,
 
Top