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.

PMSM HVPWM sensored FOC build Level 4 works only sometimes

Hi ,

I've build  a PMSM Motor application  based on the HVPWM Sensored Project.  
My Motor is driven with 40 V DC and  has 8 Poles .

The build levels 1 to 2 looks good for me . 
The Signals  seems to be ok.
Build Level 3 current loop works fine , when i'm driving  with SpeedRef in the negative range  (  until -0.99)
When i change in the positive rrange of SpeedRef ( 0 - 0.99) , i'll get  rotation , but high  Motorcurrents .

What will cause this ?

If i'm in the build level 4  with the soft switch lsw = 1 , it works like in  buils level 3 . The  modes look to be equal  .
When i  change  the soft switch lsw = 2 , i've got to  reactions :

The good one :   The motor turns smooth with a low current  , i can change the speed well , until 0 , when i
put load on the motor the Speed decreases . If i stall the motor , it comes smotth bak to normal speed .
That' s fine i think tha is what FOC should be , but this doesn't work everytime.

Sometimes when start with  lsw=2 , the Motor stalls self , causes over-current , or low speed with high current .

 I've tried to improve this by tuning the PID's but , i dont be satisfied .

 can anyone give me a hint  and help me ?

 

many Thanks ,

Dieter

 

  • Dieter,

    - Make sure that you change the iq sign when you change the direction accordingly at Level3. This might be causing higher currents.

    -Make sure that you can get a consistent and true calibration angle. Otherwise, you will be limiting your torque production and lose synhcronization. in order to make sure, create a variable in the code, and add it to the angle. When you run the motor under load, change the new variable from watch window and observe the input supply current. Ideally, when you add an offset to the angle, you should observe higher input currents. This is because you change the load angle and produce the same amount of  torque with higher current. However, if you notice that the motor draws less current when you add/subtract offset angle, then your calibration is not accurate.

    - Once a PM motor lose the synchronization, practically it can not catch it again and either stall/vibrate or become unstable.

    - Ideal way of starting PM motors is mostly following the steps 0,1 and 2. If you have to by pass lsw=1 for any reason, you can try lose PI coefficient. An aggressive control system may not be able to handle transient.

    Regards

    Bill

  • Hello Bill ,

    thank you - you helped me a lot .

    Now I've got a working FOC  until 3000 RMP .
    I checked the automatic calibrated angel detection  and  realised  that  the automatic calibrated angel made not really sense to me.  I tried to get the calibration angel  manually  put it   in my code and then the FOC   it worked well . 
    I can mechanically overload the Motor,  the speed goes to zero, i release the mechanical load and the Motor goes to 3000 RPM within 0.4 sec.
    I don't lose synchronization - great .

    Can  you give me a hint how i can get more than 3000 PRM in FOC Mode ,
    i tried to change the BASE_Freq in HVPM Sensored-settings.h from 200 to 400.
    Now i've got 3000 RPM by -0.5 SpeedRef
    but than the speed does not  getting faster if i increase SpeedRef until -0.99 .

    I think the PID-iq out is near -0.95,   the output it saturated .
    what can i do ?
    More  Phase-voltage causes more current that causes more torque - that causes more speed .
    Is that right ?

    In current loop mode i get now the 6000 RPM by changing BASE_FREQ =  400  in  the HVPM_Sensored-Settings.h .

    The problem with the other direction of  the motor  (  Speedref  until +0.99)  is not solved.  
    In the + direction I lose the synchronization at    +0.3  SpeedRef  - that's  strange .

    best regards

    Dieter

     


     

  • Hi Dieter
         I used TMDSHVMTRPFCKIT and F28035 with self servo motor.

        It didn't run smooth on HVPM_Sensorless  level 2 and level 3 build that run jiggle and nosie.

        But It can run fine with Demo code that flash at F28035(control card ) and HVMTRPFCKIT-GUIv1.

        How can I make it synchro ???

    Regards,

    Jimmy

  • Hi Jimmy ,

    its not exact my turn , I've done it with an  Encoder / sensor .

    In Level 2 be sure to have Vdtesting = 0  and Vqtesting is first on a low level ca 0.01 (Q24)

    in level 2 is no regulation loop active.

    be sure that the  phase current  offsets  are OK .

    / ------------------------------------------------------------------------------
    //  Measure phase currents, subtract the offset and normalize from (-0.5,+0.5) to (-1,+1).
    //    Connect inputs of the CLARKE module and call the clarke transformation macro
    // ------------------------------------------------------------------------------
        clarke1.As=_IQ15toIQ((AdcResult.ADCRESULT1<<3)-_IQ15(0.4970))<<1; // Phase A curr.
        clarke1.Bs=_IQ15toIQ((AdcResult.ADCRESULT2<<3)-_IQ15(0.4995))<<1; // Phase B curr.   

    if there is no motor connected  the calke1.As and clarke1.Bs must be less than 0.001 , if not , adjust  it  by changing  the bold values in the formulas above .

    If Vqtesting is not to high  you must get a normal  smooth rotation   in level 2 .

     

    in the level 3 you've got a closed current loop  . 
    The motor should have  a stable speed and when you increase the mechanical load , the current increases.

    look again at the clarke1.As and clark1.Bs offsets - adjust it . 


    I  put the IqRef  ( Q24) in the watch  window to edit it on-line,   start with low speeds  SpeedRef (-0.1)  and low  IqRef values ca. 0.01

    Idref must be 0 !   lsw=0 , motor is locked, then switch lsw = 1 .

    The motor should turn  now.

    if you increase the IqRef value  the  input current increases also the speed  stays constant  but the motor gets noisy .
    to get it work in level 3 you must perhaps adjust the PID1_iq paramater Kp,Ji,Kd and Kc.
    in my case i started with Kp=1.0 , Ki = 0.0025  kd=0   , al values (Q24)

    I dont know if that  values will work for you.

     If the motor did not start turning increase IqRef  with caution until the motor turns fine and soft.
    To get more speed  increase IqRef and the SpeedRef.

    Now your work in level 3 is done .

    level 6:

    if lsw = 1 it should work like in level 3  ( current loop )
    if lsw = 2 now the estmated angle comes into the speed loop  now it should work synchronised  , the rotor-angle 
    will be hold nearly constant  = FOC .

    But now , perhaps you have to adjust the PID_Speed1  Parameters well .

    To get sensoreless FOC try to set lsw=2  in level 6 and look if the  motor ist turning smooth.
    But now , perhaps you have to adjust the PID_Speed1  Parameters well .

    But this will not work from Speed 0 -0.99 .  In my low voltage rig , it works just from 0.25 - 0.6 outside this range it's unstable


    I hope i could help you a bit .

    best regards,

    Dieter

     

     

  • Dieter

     

    If you are saturating PIDs, then :

    -make sure that you apply high enough bus voltage for your system

    -or change the PI coefficients, especially P. At higher speeds you may need to reduce it.

    -check the rated speed of the motor. internally generated backemf might be higher than the terminal voltages you are applying which might be causing problems (sounds like this is not the case in your app) If you want to go beyond rated speed you have to do field weakening.

     

    Regards

  • hello  Bill ,

    thank you   for your hints.

    Now   the FOC  Mode in lsw==2   Build - level 4  works fine . 
    I've adjust the PID- Parameters  and that was successfully .

    I have  now only the problem, that it works fine in one direction of the motor  ( speedRef = 0 -  -0.99)  .   The motor runs smooth and stable ,
    but if i change the direction by speedRef  = 0 - 0.99 )   it works until 0.2 Speedref  the motorcurrent becomes very high, i have to stop.

    In current loop mode ( lsw==1) I've got the same behaviour  one direction is ok , in  the other  direction  it does not  work right .
     
    I  think  I'll have a problem with my current measure but i  don't  not why ?
    I do my current measuring like in the Kit's from Ti with an differential  OP.

    I've started another  post :

    http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/t/131975.aspx

    to discuss   this.

    best Regards ,

    Dieter

     

     

  • Hi, Sir

     I tune clarke1.As and Bs on level2 .

    I look clarke1.Beta and Alpha curve as on picture . 

    Are they good enough  ???

    Regards,

    Jimmy

    DualTimeA-5  : clarke1.Beta   DualTimeB-5:clarke1.Alpha  

  • Hi Jimmy ,

    are that the currents when you trying  to adjust the  current offsets?

    I disconnected the motor for this test or adjusting and tried  to get very low values of
    clarke1.Bs and clarke1.As in that case.

    My values there are now lower than +-0.001.

    The  clarke1.Bs seems to be right , its symmetric  above and under zero .
    The clarke1.As.  is not right , not  really symmetrically  for me .

    Did you adjust the  current offsets  like i wrote  above ?

    I think my problems in the current mode are  also caused also by the current measuring ,
    so i will try to get more know how about that in the next week.

    You know that in level 2 your are unable to have a good  motor performance
    because there is no  dynamically regulation of the currents  ?


    best regards
    Dieter

  •  Hi, Dieter

          Thanks, You so kind . I tune it on level3 . I tune pid1_id PID on lsw=0 , then tune pid1_iq PID on lsw=1 , isn't it right ???

          I tune pid1_iq PID very diffcult and got the picture . It was some thing wrong . The motor was vibration . The speed1.ElecThrta was so different .

          I don't known how to tune pid1_iq PID.

     

    Regards,

    Jimmy 

         DualTimeA-4(rg1.Out);
        DualTimeB-4 (speed1.ElecTheta);
       DualTimeA-5 (clarke1.As);
       DualTimeB-5 (clarke1.Bs); 

  • Hi Jimmy,

    sorry for my late answer ,
    if i look at your pictures i wonder what your speed1.electricTheta shows .
    That must be the estimated  angel, in the best case it looks like the rg1.out .
    So is  it in my sensored FOC  here and i'm sure  that it must be the same in the sensorless.

    But in Level 3 you are in the current mode so   the  estimated  angel  does'nt matter .
    But the speed1.electricTheta looks strange.
    The currents don't look so bad for me.


    PID_Iq Tuning :

    In level 3 ,  i had to set the IqRef  manually , so that the current ist not to high  and the Motor turns slow.
    If the IqRef ist to high , the Motor runs not good , if the IqRef ist to low the Motor stall's .
    So i tried different values until the motor runs quit at low speed .
    Then i  increased the Kp from the PID3_Iq  from 1.0 to 2.0 until the motor began to jiggle .
    I reduced the Kp until the Motor runs quit and than i  get a small Ki  in my case only 0.00025 .
    Than my Motor works fine .   To increase the speed  i had to increase the IqRef .

    I hope i could help you a little bit ,  I'm also learning  in this weeks .

    best regards
    Dieter

  • Hi Dieter,

        Thanks, I review my servo motor parmeter , then tune I Loop . It is ok now .

       Regards,

    Jimmy 

  • therefore, motor cant rotate nomallly and long with the level equal to 2?