Mark,
Yeah, for precise positioning feeding the pulses back into the PIC and count them OR integrate generated velocity over time to calculate position. Possible but not exactly easy to get right, I'd say.
But for the application described here I don't think precise position control is needed, just precise velocity which the CCP module will do without any software overhead - except during acceleration.
Depending on the needed frequency and acceptable jitter perhaps the NCO available in some devices would be even better for this.
David,
At your desired conveyor belt speed, what approximate frequency are you generating? Is it 100Hz, 1000Hz, 5000Hz?
For the CCP module you could use the HPWM command but if you want to implement acceleration then I would ditch HPWM and set the registers manually.
/Henrik.
Bookmarks