There are a number of links on the pages I referenced that discuss the topics you have asked about. Absolute solutions do not exist. In general, and for the hobby robot motors we are using, a higher PWM frequency is best and I generally run my freq at 19.2 kHz or higher. You should experiment - but most importantly, you should read up on the different things that could affect the freq. See the referenced page and visit the Seattle Robotics Society Encoder article at: http://www.seattlerobotics.org/encoder/sep99/pwmmail.html In fact, since you are doing a robot, I would recommend you join their list. They come up with some good tips. Dan >Hi Dan > >Thanks for the informations they are very useful. And the other thing is >that what PWM freq did you used?? is it the higher the better or low ?? > >Yhanks >----- Original Message ----- >From: Dan Creagan >To: >Sent: Saturday, January 29, 2000 12:25 AM >Subject: Re: PID control using PIC > > >> I use the 16F876 (and 16F873 and 16C73A) on robot drive motors. The PWM >> outputs are useful for controlling the motors. What kind of PID control >> are you wanting to do? >> >> There is a simple hookup of a single channel (one motor) at >> http://204.233.101.40/robots/mogotut/simplemotor.htm that might help. >There >> are some links on there that describe how to make a more complete PID, and >> there is software for a simple (proportional gain only) feedback for the >> motor experiment. The code is in Pic Basic Pro - but could be converted >to >> about any language fairly easily (which is why I chose PBP). >> >> Dan >> >> > Hello Everyone >> > >> > I am wondering whether it is possible to have PID control using 16F84 or >> > 16F876. And where can I find the source code , Thanks