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.

PID constants in TMS320C2000 Motor Control Primer

Other Parts Discussed in Thread: CONTROLSUITE

Hi everyone!

 

I am new to the DSP world and my first target is implementing PMSM  vector control using TMS320C2000 Motor Control Primer.

After had gone through a considerable part of the library, I decided connecting my motor and it didn't start up. I started debugging the code and noticed that one problem is the how I defined the values of my PID gains (kp, ki and kd). I am familiar with the PID theory, but I am not sure about how to enter the values I have for my PID in the code.

I see that the maximum value of kp can be 128, and that there maximum and minimum limits, but I don't get it. Are those based on pu values? Is there an special fractional way of inserting my PID gains in the code so it makes sense?

Please, if someone has experienced that, I would be glad to receive some help. I could not find any information about it on the application notes.

Best regards

 

Goncalves

 

  • Hi, Did you find out how to tune the gains?

    I am looking for similar info.

    Thanks !

  • Hi,

     

    No, I actually got a response from TI support saying the tuning should be made "by hand".... and that is what I did.

    What I found was some information about Kc, another constant which appears in the code.The Kc is a constant which regulates the "windup" effect of the integral gain, Ki.  If you send me your email address, I can forward you a nice pdf about it.

     

    Regards

    G.

     

  • Hello, thanks for the response!

     

    I updated the email in my profile instead of posting here. Can you check there? 

     

    Thanks !

     

  • Hi JG,

    Could I get the link for the nice pdf.  Me too need to get more info on tuning the PID's for the motor control application.  Pl share if you could on how to go about it.

    thx

  • The pdf they are talking about can be found in the controlsuite. It basically describes the pid macro. 

    As far as tuning is concerned, you could either just use some of the methods described on the web or simulate an accurate model of the various loops, and arrive at appropriate gains. You can use the datalogger to save data from a step response and based on that modify your gains.

  • Thanks for the info.  Your suggestion of datalogging looks cool.  I started working on this and its rather iterative but should be positive.  I have a problem that the custom motor runs at speedref of 0.005 to 0.015.  Any value more than these stalls the motor and hence I am unable to get full view of the CCS graphs.  Let me know how to tweak the basespeed / speedref (with F2812 and F28069) so that I could get full spectrum.

    thx & rgds

  • Yep, PID tuning is mostly done with iterations. Although with an accurate model you can "calculate" gains. 

    Does your custom motor have similar resistance and inductance values as well as the number of poles? Have you made sure your motor connections etc. are correct? Finally, have your tried lower and higher values of VqTesting? 

    By the way is this a custom board - do describe your setup. Did your setup work with the motor provided with this kit?

  • Hi,

    Pl find below the answers to your queries

    Does your custom motor have similar resistance and inductance values

    Resistance is approx     #define RS         0.0706

    Inductance is not known and hence retained the original value #define LS       0.0435.  The motor is a coreless motor and hence the inductance would be quite less.

    number of poles is 40

    Have you made sure your motor connections etc. are correct? - Yes they are indeed correct.   Motor rotates though without any hiccups.

    Finally, have your tried lower and higher values of VqTesting?  - Tried till 0.25

    By the way is this a custom board - F28069 is the experimental kit while F2812 is based on 2812 eZdsp. The power board is custom board with the data taken from DMC1500 and thus the layout is similar.

    Did your setup work with the motor provided with this kit? - I did not buy the motor along with the kit.  But have the pittman PMSM motor for testing purposes purchased along with MCK240 motion control kit from technosoft.

    Pl let me know if you need any more info.

    thx & rgds

  • In your first two build levels, were you able to see the resulting waveforms from space vector modulation? Have you confirmed that your board can actually support the amount of current drawn by the motor? Try a higher VqTesting value.

    Verify the PWM output on a scope and that the ADC sampling is occurring properly. 

  • Hi,

    Pl find enclosed the resulting images for the level 2.  My custom power board is capable of handling 50 Amps and hence should be of no concern.  I would be doing other tests as suggested by you.

    thx

    level2.ppt
  • The space vector graph (A-0) seems okay. Not sure what B-1 and A-1 show. Will help if you label the graphs.

  • Hi,

    A-1 and B-1 are ADC inputs i.e., current sense.

    thx

  • Check your ramp gen module step angle max. Are Base frequency and interrupt period ( T ) correctly defined? Given that your motor has 40 pole (20 pairs), and considering it can run at 3000 rpm (take this to be base rpm), try 1000 as Base frequency. The period of the simulated electrical angle (output of rampgen) and phase currents are similar which is why I think you need to verify that the electrical angle has appropriate frequency.

    P.S.: Being mindful of the effect of the change in BASE_FREQ on other parameters such as speed gains etc. You may want to directly enter those values instead of expressions involving BASE_FREQ. If currently your BASE_FREQ is 200, that means that your base rpm is 600. Also can you provide a link to your motor's data sheet?