I am working on a motor control project and i have a simple question.
The QEI i am using is a 16 bit register, and it will increment
everytime the encoder counts. The encoder i am using has a 200 cpr
(counts per revolution). So if the wheel spins 1 revolution, the QEI
register should have a value of 200.
Using this logic,
#revolution = total_counts / cpr
and RPM = #revolution / min
So, RPM = total_counts / cpr / min
However, i have a couple of questions. First, how do i set up the duty
cycle of my PWM signal? For example, If i want a 80 RPM for my moter,
and i am using a PWM period of 2kHz, what would the duty cycle be?
Second, what is prescale for, do i need it?
thanks for the help,
17 years ago