Jan, You were right on target! I did a very simple application that at every 20ms cycle, it increases the PWM by one degree (I know, the units are kind of messy, but I guess you'll understand). When it reaches 60 degs, it starts decreasing until -60 and then repeats forever. I also have a constant to control angular speed, and I've tested with slow and fast speeds (up to the servo limit speed) and they all work flawlessly. I feel that I wasn't too polite not answeing your questions, so here they are: > What resolution (in degrees or ms or whatever) do you need ? > +/- 1 deg ? > +/- 0.1 deg ? 1 degree is fine > How many descreet steps ? 100 ? from -90 to 90, therefore 180 discrete steps, although I think -60 to 60 is what I will end up using. > I would probably not try to send a measurment it "real" units, > but something more efficent. Right now I'm sending a word with the pulse width in microseconds, what would you suggest? > > If the current angle is let's say -20 and I send a message > > "go to +60", the servo responds immediately and its motion is > > very smooth (I guess it goes at its regular operating speed - > > 0.19sec/60deg), but if I grab my pointer on the user > > interface and drag it, the motion of the servo is very bumpy > > and jittery. It will end up where I release my GUI pointer, > > but the trajectory will be rough. The same roughness can be > > perceived if you are measuring the signal on the oscope. > > What "signal" ? The PWM signal probably, right ? right > Note that sending characters out from a serial port on a > (Windows ?) PC isn't realy a "real time" process. My guess > is that you actualy have a "bumpy" stream of characters > comming out of the PC. Can you add a "logging" feature to > your PC program that logs exactly whats sent out ? Best would > be a serial line logger with timestamps on each byte. It already has a simple one, it logs a list of messages sent and all of them are in increasing order (if I'm increasing the angle, of course). I also did another test by sending a stream of messages created on linear time, instead of dragging the pointer of my GUI application, it is still bumpy, but you're right, the problem is somewhere there I guess. > I'm not sure what speed your PIC is using, but getting an INT > fromt eh USART, saving the byte and RETFIE'ing whould not take > many us's, so that should not mess up your hardcoded timing > code that much anyway. I guess I could do another test using the "wiper" code I just did (-60 to +60 forever) by including again the USART code in there but not using it to change the servo angle, but I agree with you that the problem is not likely to be there. > No, I'd take a closer look at whats actualy is sent out from > the PC. Do you have any suggestion for which tool to use in this case? Thanks! Padu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist