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 Calibrate the Position on PMSM on sensored FOC

Dear Friends and TI Engineers,

Currently, I do some research on PMSM FOC. I buy the TMDSHVMTRPFCKIT development kit from TI last month and I used 2HP PMSM motor with an incremental encoder 2500 PPR.

I have some difficulties regarding rotor position calibration. Based on the explanation from the ControlSuite, if we want to lock the rotor into d-axis, we can set the Iq=0 and Id=some constant value then the rotor will move a little to align with the d-axis. This step happened when I did this step, but sometimes not. I guess this is depend on the first rotor position (if it is not, please correct me). Now, I only able to rotate the motor in 100rpm. The motor will stalled if the speed is over than 100rpm.

The problems :

1. does it happened because of the position not calibrated?

2. how to know the rotor position has already align with the d-axis from the code/watch windows?it said on the application note that when the first index signal is detected by the QEP, the QPOSILAT latches the angle offset in between initial rotor position and encoder index. How to get the offset angle?

3. on the application note also writen CALIBRATION ANGLE= OFFSET ANGLE +- n.LINE ENCODER. what is n.LINE ENCODER? on the code from ControlSuite, the default calibration angle value is 1000 for 2500 PPR encoder. do i need to change the calibration angle value each time the program is restart?

Can anybody give me some help regarding my problems? I'm still learning about PMSM FOC control.

Thank you~

  • I think two way:

    1)Set constant speed and change offset angle to min value of Uq.(region wihtout field weaking).

    2)Set constant torgue on constant speed.And change offset angle to get max torque to constant amper.

    Dmitry.

  • Dear Mr. Dmitri

    Im done with calibrating the absolute position. I used the method by setting the Iq=0 and Id=notzero. It will force the rotor to lock on the absolute position. anyway, now i can rotate the PMSM. Now i'm facing another problems. Now i only can rotate the motor with the 100 Volt DC bus. But when i increase the DC bus into rated voltage of the PMSM (300 VDC) it won't rotate. The rotor was stalled. I'm guessing that this problem occurs because of inappropriate PI gain of the controller. Do anyone have idea how to decide the PI gain correctly???

  • Try tuning PI with ref speed=0;

  • Dear Mr. Wahyu,

                  How did you come to the point that the motor is stalling because of inappropriate PI tuning? I feel there is some error with the QEP feedback signals coming in athigher bus voltages. Do you think it might be a reason ?

  • Hello Mr. Aravind

    I came to that point because my PI gains was work for 100 VDC. The motor rotate smoothly and the dq current signal was following the reference. The QEP feedback signals was perfect. no disturbance or noise at all. Furthermore, I used JTAG with high voltage isolation, so i think the error caused by the QEP disturbed by the high voltage is impossible.

    Anyway, now I can rotate my PMSM with 200VDC after some PI retuning. Now my FOC works perfectly. So I think my point is correct. PI gains need to be tuned correctly. For your reference, you can read the blog written by TI engineer with the title "Teaching your PI controller to behave". that blog was helping me a lot to understand the PI tuning on PMSM FOC system.

  • Dear Wahyu,

         Thanks for sharing your time. I will be reading through the blog and I'm sure I can also find the right tuning parameters for the motor at higher voltages. But before I do that, I have a couple of doubts

    1. The reason why I said I feel the QEP signals are erraneous is because, at build level 4, keeping lsw = 1, when I run the motor at a particular set speed, I had used the DAC in the board to view the feedback coming in from the motor ( to be precise, I was measuring the speed1.ElecTheta using the DAC). At voltages below 100V AC, the measured theta values were clean ramps without any noise, but as I increased the voltage, there was noise coming in to the signals and there was some distortion in the ramp. Have you noticed this while you were working on the board? It will be greatly helpful if you can confirm this for me on your kit.

    2. Secondly, in build level 2, it is said in the user manual that we need to try different values of Vdtesting and Vqtesting and thus find out the operating range for the motor. It's also said the vectorial sum of Vqtesting and Vdtesting should not be greater than 1. When I tried to work on this, the motor stalled even with values of Vdtesting = 0.2 and Vqtesting = 0.32. This is way below the 1.0 value mentioned by them. Why is it so?

    Kindly help me out with these 2 questions.  

  • Dear Mr.Aravind,

    I saw your experimental result on your threads. I think your motor was rotate backward based on your electheta graph. you should change the motor cable UVW connection first to get forward signal information. And I think, you should try to used the DLOG information on your GRAPH tools. By using the DLOG the result become better because the DLOG sampling time was tighter if we compare with just a GRAPH tools. Just in my opinion after I saw your graph result, maybe you used the GRAPH tools directly with chosen variable from the watch windows. If you do this, the sampling time is big (i think the Ts=1s), thats why you think your QEP was distorted by the noise. In my case, I can get clear theta information on every build and any DC bus voltage(almost the same with the tutorial provided by CONTROL SUITE) using the DLOG information. How to used the DLOG was explained in the tutorial before the BUILD parts. You can check it.

    For BUILD LEVEL 2, i think I understand what is your problem, because I also met that problem. Here what you should do. Actually the manual was not wrong. It said that you need to increase the Vd and Vq testing slowly. But don't forget to increase the speedref also. Because when the Vd and Vq increase, the speed need to be increased. You need to be patient when increasing this 3 variable. Do not increase those variable abruptly. try 0.01 increment for each variables and see what happened. If you hear some noise, it means you need to increase the other variables. In my case, I can reach 0.7P.U for speed ref and Vq testing =0.7 and Vd testing = 0.8, and still can be increased. You just need to increase the value for each variables slowly. Actually, I think this BUILD level 2 can be skipped, because if your motor is normal, your motor can reach 1 PU for every variables.

  • Dear Wahyu,

           Thanks for your time. I will work on the build level 2 as you suggested.

            Regarding the 1st part, I actually mapped the qep1.ElecTheta to the 1st channel of DAC available on the board and saw it using a DSO. I gave my observation regarding a small noise in the QEP with that step only. I had not closed the speed loop and the noise was present in the QEP feedback. Can you please check again if you have the same observation or can you please suggest a possible reason for such a  noise?

  • Hi Mr. Wahyu,

    In the build level 4, I am plotting qep1.ElecTheta on the 1st channel of DAC available on the board. I am following all the other steps as provided in the controlsuite documents. At lsw = 1, at voltages lower than 100V DC, I am getting a clear ramp in the DSO for the qep1.ElecTheta variable. However, when I increase the DC bus voltage, I see some noise in the qep1.ElecTheta value. I am attaching a snapshot of the noise affected qep1.ElecTheta alongwith this post.

  • Mr. Aravind, In my case, i didn't check the QEP signal from the PWMDAC of he board, I only check the signal from the DLOG. I did this because when I used XDS100 JTAG, the DSO connection was interrupting the signal on the kit board and made my program halt. I think this is very dangerous so thats why I don't want to check the signal using external DSO. Anyway, now I change my JTAG with SDS100i and i can neglect the disturbance because of external signal. 

    In my experience during build 3 or 4, with lsw=1 and VDC > 100 V, I also witness same phenomena as yours. The QEP signal was distorted. I found the reason is because the DLOG prescalar value needs to set into new values (you can found this code on the program). After I enter new value, so I can get clear QEP signal. 

    Furthermore, if you only works on lsw=1 state and you want to increase your motor speed, you need to increase the Iqref too. Because when the speed increase the Iq need to follow the speed ref in some values.