Greetings Programming Gurus
My project consists of 2 servo motors which will receive position commands serially from PC. I have decided to use PWM of CCP1 and ECCP1 of PIC18f458.
I plan to build a "Pan and Tilt" and not use gears at all. I would be using servo motors with -90 to +90 degree angles. At the bottom would be Servo 1 rotating in X plane, and on top of that would be the Servo 2 rotating in Y plane.
My algorithm as yet is (Please comment or improve)
My main routine would be to monitor serially received data. In parralell I would run the CCP and ECCP modules. Timer flag of CCP and ECCP is reset using interrupt.
My query is that lets say servo point -90 at 1ms and +90 at 2ms. If I produce a 20ms square wave, I would have very limited positions between 1ms and 2ms. So should I produce a square wave of 2ms and then varry its 256 PR2 values to produce unique positions or stick with 20ms or is there a better algo, instead of using PWM, should I use Capture mode ? (I have no experience with servo motors)
PLEASE HELP ME ALL THOSE WITH KNOWLEDGE OF SERVOs
My project consists of 2 servo motors which will receive position commands serially from PC. I have decided to use PWM of CCP1 and ECCP1 of PIC18f458.
I plan to build a "Pan and Tilt" and not use gears at all. I would be using servo motors with -90 to +90 degree angles. At the bottom would be Servo 1 rotating in X plane, and on top of that would be the Servo 2 rotating in Y plane.
My algorithm as yet is (Please comment or improve)
My main routine would be to monitor serially received data. In parralell I would run the CCP and ECCP modules. Timer flag of CCP and ECCP is reset using interrupt.
My query is that lets say servo point -90 at 1ms and +90 at 2ms. If I produce a 20ms square wave, I would have very limited positions between 1ms and 2ms. So should I produce a square wave of 2ms and then varry its 256 PR2 values to produce unique positions or stick with 20ms or is there a better algo, instead of using PWM, should I use Capture mode ? (I have no experience with servo motors)
PLEASE HELP ME ALL THOSE WITH KNOWLEDGE OF SERVOs