I just built a atmega16 based servo. The PID code is actually quite simple to do. I don't have a real servomotor, so I just attached an incremental encoder to a cheap 90vdc motor.
However, it worked surprisingly well when tuned. The motion feels quite stiff, almost like a stepper motor. Unfortunately, the mosfets fried after a day, so I'm troubleshooting it now. |