View Single Post
  #2   Spotlight this post!  
Unread 13-10-2005, 01:49
sciguy125 sciguy125 is offline
Electrical Engineer
AKA: Phil Baltar
FRC #1351
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Sunnyvale, CA
Posts: 519
sciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond repute
Send a message via AIM to sciguy125 Send a message via MSN to sciguy125 Send a message via Yahoo to sciguy125
Re: Servo behavior question / advanced servo/PIC programming question

Alright...
As far as I know, hobby servos only go to 120 degrees. My guess is that most people want them to stop well before the hard stops. During my attempts to make a servo controller (code attached), I discovered that going too far out of spec for the signal tends to anger the servo (yes, anger). I got some very strange behavior out of them. I didn't run any experiments to specifically get beyond the 120 degree limit though.

As for the CCP module on the PIC, you'd just have to slow down the clock. It'll go as slow as you want (as long has you have the hardware for it). One thing you might want to keep in mind though is that the duty cycle for the servo signal is very low (<10%). This cuts down on your signal resolution.

However, I do have some code to drive a servo. It's designed for the 16F84, but I'm sure it'll work with many others. It's for 4MHz. If you don't run it at that speed, you'll have some rewriting to do. Aside from being experimental, it was also my first attempt at writing anything for the PIC (or anything in assembly for that matter), so it's pretty messy and inefficient, but it gets the job done. The bad thing about it is that all the delays keep the processor busy (dummy instructions) so you can't do anything during those times.

The better way to do it would probably be to use one of the timers. Set the output high, set the timer, set the output low when the timer expires. That way, you can do whatever you want while you're waiting. But again, I don't think you'll be able to feed it a signal to go beyond the 120 degree range.

Another interesting project would be to take the electronic guts out and redo them. I think I might try that some day...

Edit:
Ok, apparently, I can't attach it because I attached it in another thread.
__________________

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------

Last edited by sciguy125 : 13-10-2005 at 01:53. Reason: forgot to attach code