Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Would this work with RC servos?

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
I intend to control an RC servo using a signal repeating every 4 ms instead of the usually advised 20 msec.

The variation of width will be as required between 1 and 2 ms. No changes here, of course.

Should I expect any problem or is it OK?

Any reply appreciated.
 
It's only the MARK that sets the servo position, the SPACE doesn't seem to matter?. But usually you're making the SPACE longer, not shorter, but I see no reason why it won't work - but I should test it first!.

Why are you wanting to use a shorter SPACE anyway?.
 
The reason for that

Using a 16F628 with 4 MHz clock I couldn't find a way to get the usual 1 to 2 ms every 20 ms but only every 4 ms :!:

The values I've got yesterday were, for 10 bits to be writen to CC1PRL and CCP1CON b5:b4 :

250 for 1 ms
375 for 1,5 ms
500 for 2 ms.

For the period, I get:

prescaler : 16
PR2 : 255

giving 244 Hz, that is: 4 ms (app) period.
 
running a servo at 250 hz is pushing it a bit - some servos will work at that high of a speed, others won't. Try it - and if it works monitor the temperature of the servo - if it's getting really hot then, obviously, you have a problem. Most servos will work up to around 200hz. Some will stop working well before that, unfortunately. I've heard some of the digital ones can go to 400hz - though I don't have any digitals so I am unable to verify this.
 
Re: The reason for that

atferrari said:
Using a 16F628 with 4 MHz clock I couldn't find a way to get the usual 1 to 2 ms every 20 ms but only every 4 ms :!:

The values I've got yesterday were, for 10 bits to be writen to CC1PRL and CCP1CON b5:b4 :

250 for 1 ms
375 for 1,5 ms
500 for 2 ms.

For the period, I get:

prescaler : 16
PR2 : 255

giving 244 Hz, that is: 4 ms (app) period.

That's because you're trying to use the PWM module, it's not intended for servo's, and it's not really suitable - there's plenty of PIC servo examples on the net, google will find them for you.
 
Hello all.

This is not 100% relevant but I believe it may help a bit.
I was working with parallax cont. rotation servo working perfectly with the pulse that it required.

However there was another guy in the lab that was using the same motor with totally different timings but the servo worked just fine! The reason why his timings were wrong is because he messed up with the prescaler. However the "duty cyle" (percentage) of the pulse was correct even if the duration was wrong. Now the key to the whole situation is that those servos had a screw which you can use to adjust its stability. I believe this is why his servo also worked.

Thanks.
 
Status
Not open for further replies.

Latest threads

Back
Top