
Originally Posted by
infinitrix
can i use the code to control speed and position of motor using same pic?
First step (get), you Get variables from hardware (via pot, encoder, ...)
Second step (control), you correct those variables (PID between desired and got variables)) to reach your desired speed, direction & position by PWM and polarity (depending on the type of motor DC, BLDC or what ever). That is control.
And yes, both steps you can perform them in a single MCU. Motor control oriented MCU's works great for this, such as a dsPIC30F3011; or for this compiler, a PIC18F2431 (or any of the family PIC18Fxx31) which have QEI peripheral, where QEI stands for Quadrature Encoder Interface, which decodes signal from a rotary Quadrature Encoder, ideal for gathering motor rotation activity.
Rodrigo M.-
Last edited by RodSTAR; - 27th March 2009 at 17:36.
"Beethoven had his critics too, see if you can name 3 of them"
Bookmarks