Hello,
I bought the DRV8412-C2-KIT, and I added a coder linked to J2 and to a motor.
I added a few lines in the program (using CCS) to add a variable to know how many rotation has the motor done, but it doesn't seem to work. Here is the program (added in the file 2xDC_Motor.c) :
if (EQep1Regs.QPOSCNT == 0) // QPOSCNT in INDEX mode (00)
{
qep1.NbTour = qep1.NbTour + 1 ; //adds 1 each time the did 1 rotation
}
The program thas increment, but it thas it much to quickly. I first tried with RawTheta, but that to didn't work out.
I checked the LineEncoder of the coder and entered the correct number in the program, so that's not the problem.
Would you know what I should put in the program to get the number of rotation of the motor?
Would it be possible to enter a number of rotations, that would be send to the coder which would make turn the motor of the number of rotations?
Can anyone help please?
Thanks