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.

How to calculate calibration angle in PMSM3_1

Other Parts Discussed in Thread: TMS320F2812, HVPMSMMTR, CONTROLSUITE, TMS320F28335, MOTORWARE

Hi All,

I'm working on sensored field oriented control of PMSM (with Encoder + FOC) using TMS320F2812 eZdsp kit and referring to PMSM3_1 application note for the same. I have completed incremental build level 3 - PID Tuning for Id and Iq and also have verified the encoder feedback signals to be correct in build level 4.

Now I am stuck up with the issue to setting a correct value for the parameter qep1.CalibrationAngle in the program.

I am using the following text as a reference as given in document PMSM3_1 pg. 27-28. (sprc129)

I followed the given instructions. Whenever I set LockRotorFlag to 1, motor stops spinning and get locked but each time I get a different value in EvaRegs.T2CNT with random repeatability of a couple of  values.

Please let me know how do I set a correct value for the parameter 'Calibration Angle' and how to verify if the value is correct.

--

Hrishikesh Mehta

  • Hi,

    You will probably need to add the following lines before the QEP_MACRO is called in the interrupt:

     if (lsw==0) 
     {
       EQep1Regs.QPOSCNT=0; 
       EQep1Regs.QCLR.bit.IEL = 1;
     } // Reset position cnt.
    
    if ((EQep1Regs.QFLG.bit.IEL==1) && Init_IFlag==0) // Check the index occurrence  
    {
       qep1.CalibratedAngle= EQep1Regs.QPOSILAT; 
        Init_IFlag++;
     } // Keep the latched pos. at the first index

    Refer the HV Kit code more detailed implementation.

    Regards,

    Gautam

  • Thanks for the reply Gautam. The TMS320F2812 DSP doesnt use the eQEP module. So this piece of code cannot be used directly there. Only if I get a correct value for qep1.CalibrationAngle my problem would be solved.

  • Ohh! F2812 has event manager :)

    Sorry Hrishi, I'll have to go through the datasheet for this. Myself, being a bit busy would request you to be patient. By tomorrow you should receive an expert's opinion.

    Regards,

    Gautam

  • there are many 0 electrical angles per a given mechanical rotation, depending on poles.

    Every time you do a LockRotor you are injecting Id current to align the rotor to the closest 0 electrical angle. So it should be repeatable to the number of pole pairs you have.

  • Yes Chris.. You are right but each time when I set the LockRotor flag to 1, I get a different value.. I tried the values which have high repeatability and used it in build level 5 but motor wont spin with those values.. So I if you can guide me with the procedure of verifying a correct value for Calibration Angle, then that would be useful..

  • Hrishi,

    I think we have reached the limit of the support we can provide on F2812 (15 yrs since we announced) and this application software (last update 2005, first created in ~2003).  I would recommend upgrading to more recent HW & SW.

    TMDSHVMTRPFCKIT + HVPMSMMTR

    and controlSUITE

    will allow you experiment with TMS320F28335 and Encoder based or sensorless projects.

    You could also take this same HW set-up and purchase TMDSCNCD28069M and experiment with www.ti.com/instaspin-motion , supported through MotorWare (instead of controlSUITE) which is an incredibly effective servo position control with motion solution.  It's the premium solution that we have available.

     

  • Thanks for the suggestion Chris. I have been using TMS320F2812 for the last 1.5 years and suddenly shifting the platform wont be that feasible immediately for me. It can surely happen over a time period. Can this issue be solved in any way by not shifting the platform I am currently working on?..

  • we don't have a way to support you on this 9+ yr old software. We don't have any of the HW here and no one has used this software. 

    Doing a LockRotor (Id), reading the count, and using that as your offset is the standard way to do things.  We still use the same process in our InstaSPIN-MOTION with Position control.