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.

TMS320F28P650DK: Variables not refreshed in debug mode

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: CONTROLSUITE, TMS320F28379D, C2000WARE

Hi,

I launch the PM_sincos_example project in debug mode, all seems to be okay, but the variables of the mySincos object are not refreshed and I don't understand why.

Please find the screenshot and the picture in attachment.

Thanks in advance for your support,

David

  • Hello David,

    When you step through your code, do you see any changes in the variable's value or is it remaining static even after you execute lines that should change its value? Are optimizations disabled (as they should be when running a debug session)? Were there any warnings upon building your project?

    Best regards,

    Omer Amir

  • Hi Omer,

    Thank you for your reply.

    I have no warning upon building the TI example project.

    All optimizations are disabled.

    I use the C:\ti\controlSUITE\libs\app_libs\position_manager\v01_00_00_00\sincos\examples\PM_sincos_example project from TI as is.

    I also tried the C:\ti\controlSUITE\libs\app_libs\position_manager\v01_03_00_00\sincos project, same problem, the mySincos is not refreshed.

  • Hello David,

    Can you step through your code and show me a line that should modify the variable in the Expressions window? You can just show me the before/after execution and what the value should have been loaded with.

    Best regards,

    Omer Amir

  • Ok, I saw what was the problem. I want to use a TMS320F28P650DK9 with the IDDK and this example code, but it is not compatible as is. I defined the good target but it has some source files that are specific to the TMS320F28379D by defaut in this example project. How can I do to replace them easily to TMS320F28P650DK9 source files please?

  • Hi David,

    I noticed the driver functions are still for device F28379D. Could you check if it is configured properly to run F28P65x? In our latest version of C2000WARE_Motorcontrol_SDK, we have an example based on F28P65x and IDDK, which you could take as a reference. 

    Thanks,

    Jiaxin

  • Hi,

    I use now the IDDK dev kit with the C28379D control card.

    I follow the SPRUI57 user's guide to read sin/cos values of my analog encoder. H4-7 delivers normally +5V to power supply the encoder, but I have only 1.3V by default when I follow the HW setup recommendation. Indeed I need to enable the encoder 5V power by putting 5V on the ON/OFF pin of the TPS27082, in other words I need to put 5V on H15-4 (I use H2-4 for that). This big info is missing in that user's guide.

    Then I can see Sine and cosine analog signals on the M13-A and M13-B test points with my oscilloscope, but nothing in debug mode. When I look at the IDDK v2.2 schematics SC-A and SC-B are respectively linked to SC-B2 and SC-A2 trough J15 and J16. Why do you proceed to a HW swap?

    On the IDDK schematics, SC-A2 is linked to AD-C0 and SC-B2 is linked to AD-D0, but in the sincos_init() function of the C:\ti\controlSUITE\libs\app_libs\position_manager\v01_03_00_00\sincos project ADC block A and ADC block B are initialized instead of ADC block C and ADC block D.

    I have checked the C:\ti\controlSUITE\libs\app_libs\position_manager\v01_00_00_00\sincos\examples\PM_sincos_example project and there it is correctly initialized.

    When I launch the debug mode, I display ftheta on a graph and I see that its value changes when I turn the rotor manually, but I have no decimal part, only x.0 (1.0, then 2.0 and so on). I guess the unit is in rad, so I don't understand why I don't have any decimal part. Could you help me on this point please?

    Best regards,

    David

  • Hi David,

    Could you please check if your pulse per revolution (PPR) is set correctly?

    Thanks,

    Jiaxin

  • Where can I check that in the code please?

  • Hi David,

    Could you please check these two variables: "mySincos.qmaxpos" and "mySincos.qep->QPOSMAX" in the file "PM_sincos_lib.c"? They should be loaded of value (PPR*4-1).

    Thanks,

    Jiaxin

  • Hi,

    Now I see fine angle part (the calibration process wasn't complete before).

    LINECOUNT is the number of electrical cycles per mechanical rotation of the motor or of the encoder?

    What is the unit of mySincos.ftheta please?

    Best regards,

    David

  • I have a 15 pole pairs permanent magnet synchronous motor with a 1 pole pair analog sin/cos encoder (absolute). How do I have to tune the defines please?

  • Hi David,

    LINECOUNT is the number of electrical cycles per mechanical rotation of the motor or of the encoder?

    Yes.

    What is the unit of mySincos.ftheta please?

    The API function "PM_sincos_calcAngle()" computes the mechanical shaft angle in scaler per-unit.

    Thanks,

    Jiaxin