This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
I have the next configuration in eQEP:
{
EQep1Regs.QUPRD = 2000000; // Genera eventos periódicos de tiempo para escribir. Aprox 100Hz at 200 MHz SYSCLKOUT
EQep1Regs.QDECCTL.bit.QSRC = 00; // QEP contador en modo de cuadratura
EQep1Regs.QEPCTL.bit.FREE_SOFT = 2;
EQep1Regs.QEPCTL.bit.PCRM = 00; // Restablecimiento del contador de posición en un evento de Index
EQep1Regs.QEPCTL.bit.UTE = 1; // Habilitar temporizador de unidad
EQep1Regs.QEPCTL.bit.QCLM = 1; // Latch en la unidad de tiempo de espera
EQep1Regs.QPOSMAX = 0xffffffff;
EQep1Regs.QEPCTL.bit.QPEN = 1; // QEP habilitado
EQep1Regs.QCAPCTL.bit.UPPS = 5; // QCLK/32 para el preescalador de eventos de posición
EQep1Regs.QCAPCTL.bit.CCPS = 6; // SYSCLKOUT/64 para el preescalador del temporizador de captura de reloj del eQEP
EQep1Regs.QCAPCTL.bit.CEN = 1; // Habilitar captura eQEP
}
And I have a interrupt for ADC of 20kHz and themotor rotates at 100RPM.
I need the engine speed calculation to be done faster. How can I do it without altering the speed value?
Can you explain what you mean when you say you "need the engine speed calculation to be done faster"? Is the execution time of your calculation too long or are you referring to the frequency at which the calculation is performed?
Whitney
Thanks for answering.
Excuse me, you're right, I wasn't too clear.
I was referring to the frequency at which the calculation is made.
Thanks.
And how often is it running currently? What is triggering its running? Are you using the calculation shown in the eqep_pos_speed example or some other source as reference?
Whitney
I have added the controlSUITE example to the project.
I am running the "qep_posspeed.calc (& qep_posspeed);" For every interruption of ADC, this would be every 20kHz.
The problem is that I get "SpeedRpm_fr" values very slow compared to the interruption. That is, I need to increase the number of readings of the variable "SpeedRpm_fr".
The speed calc is done once every 10 ISRs. The QEP resolution is low enough to capture any pulse counts at high ISR, that is why such prescaling is done. If you wish to repeat it often, look for a variable such as 'speedLoopPrescaler' or so and change it down.
Thank you for your answers.
The only parameters for pre-scaling that I have found are:
"EQep1Regs.QCAPCTL.bit.UPPS = 5; // QCLK / 32 for the position event pre-scaler
EQep1Regs.QCAPCTL.bit.CCPS = 6; // SYSCLKOUT / 64 for the eQEP clock capture timer prescaler "
Which doesn't change what I need.
When I modify:
"EQep1Regs.QUPRD = 2000000; // Generate periodic events of time to write. Approx 100Hz at 200 MHz SYSCLKOUT"
For a smaller value, I get more samples of the speed "SpeedRpm_fr" but I divide the speed by a factor of 10, that is, I have 200RPM in the engine and the program shows me a measurement of 20RPM.
I am lost in this problem. thanks for your help
I mentioned a software variable in the program and not in the device peripheral registers.
Sorry. I think I understood now.
I have not found a variable that modifies the aforementioned.
Well, I suggest you to review the code that does the speed calculation and that way you will be able to appreciate and resolve better.
thanks, is what i'm doing lately
when I modify "EQep1Regs.QUPRD = 2000000;" for a value of "EQep1Regs.QUPRD = 200000;" (divided by 10), I can increase the number of speed calculations, but affect the calculated speed value, it goes from 200RPM to 20RPM.
Did you look for the variable named 'speedLoopPrescaler'?
If you cant find it, what is the project you are referring to? Provide the path of the project folder in controlsuite.
Good morning! I could not find that variable.
The project is in:
ti\controlSUITE\device_support\F2837xD\v200\F2837xD_examples_Cpu1\eqep_pos_speed\cpu01
Can you look at an example project that shows its set up and use at the system level.
Here below is a sample project
C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVPM_Sensored_Servo
Hope it helps.