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.

TMDSIDK437X: TwinCAT issue with CIA402 example

Part Number: TMDSIDK437X
Other Parts Discussed in Thread: DRV8313

Versions of installed software on my PC:

CCS: 8.3.0.00009

TwinCAT: 3.1.4022

Microsoft Visual Studio: 2013 4.7.03056

and versions of other CCS components:

Hardware that I am using: 

Motor: Anaheim Automation BLY171D-24V-4000

Encoder: ROC 413 2048 (3,6 - 14V) Heidenhein

Board: TI IDK AM437x rev 1.4A

Hello,

I have a problem with motor control through EtherCat(TwinCat) in example project cia402. I downloaded SSC from Beckhoff and patched it with Option#1 so i can use it with cia402 example. I moved "ESI" files into Twincat folders.

Then I was following instructions described in this PDF http://www.ti.com/lit/ug/tidu800b/tidu800b.pdf. As I do not have encoder ROQ 437 Heidenhein I used encoder ROC 413 Heidenhein. I recalculated "Scaling Factor Numerator" and "Output Scaling Factor (Velocity)", becouse mine Encoder has Encoder resolution of 13. With that I changed Code in CCS :

#define TWINCAT_SINGLE_TURN_RES pow(2, [20 I changed this to 13 as described in the PDF])

#define TWINCAT_VELOCITY_RES pow(2, [20 I changed this to 13 as described in the PDF])

If i am lucky that TwinCat does not show error messages like (17245 (0x435d)- which I do not understand really)


and I can press F5(motor start), but after pressing it (when Controller, Feed FW, Feed BW Override 100 and Target Position as well as speed is set) nothing happens motor does not turn. Motor does some funny noises but its very rare its normally quiet. When I press motor stop it slightly moves to one side really fast(some 1° - 5°) its choppy motion. In the most cases the hardware motor fault of the board turns on after DRV8313 notices something wrong. Thats the only place where we modified the main CCS code, we are reading if the motor fault had happend and if the User Switch is pressed and then we send impulse to reset DRV8313 so we do not need to restart the whole program while testing. We did not find any reseting of this motor fault  in the program so we created ours.

I was thinking that maybe the endat connection with encoder was to blame becouse the TwinCat enviroment does not show current position when  we move with the axis by hand, but then I figured out that if the connection was wrong the cia402 application or motor contorol application would not run and error message would have appear that endat is not connected.

So we think that our PC is not corectly connected to the board through TwinCat or the settings and parameters are set wrong in the TwinCat enviroment.

We do not really understand why the real position does not show in TwinCat when program is running.

So final most important question is: Why is not the motor turning? When we went by the "book". PDF/website

Thank you in advance.

 

Marek S.

(Marek in English can be Marco, Mark.)

 I am really sorry if my english is terrible or it does not make sense. I am midlle school student working in "unnamed" company. I am working like summer job, brigade, And my job was to find out the most i could about the board and the proccesor becouse this company wants to make change from single core processors in their devices to multicore processors. So the employees do not now either, its new for them too.

 

  • Hi Marek,

    Which type of coupler for connecting encoder and motor are you using? It's a bit tricky to have a solid connection between encoder and motor.

    Here is the single chip motor control video demo that may help:

    https://training.ti.com/am437x-single-axis-motor-control-demo

    Regards,
    Garrett

  • Hi Garrett

    As you are saying it is a bit tricky. It is a bit worn down. The motor to Encoder is coupled like this

     

    The screws tightens the claws. They hold on to the shafts. Becouse the motor shaft is smaller and coupler little bigger that´s why we added this blue heat shrinkable rubber tube to make a connection. 

     

    I observed that when I rotate the coupler by hand and in the same time i´am holding the motor shaft still - this rubber slips. But when I run Motor control example application from Industrial drives folder the real time speed is not shown as I said but when i set the speed the coupler rotates as well as shaft of the encoder so I do not think this is the problem.

    I watched this video already. I hope that i did not miss anything important.

    Regards,

    Marek

     

    EDIT 1:

    As I was thinking throughout the day It seems a bit weird to me that it would be a problem with an a coupler even if it´s connected kind of sketchier . Becouse as I mentioned I rotated the coupler with encoder and motor shaft manually with program and TwinCat running but the current position wasn´t changing. It was the same number.

  • Marek,

    Please double check if you have the device variables linked to the axis variables correctly as shown in Table 1 of the TI design http://www.ti.com/lit/ug/tidu800b/tidu800b.pdf

    Also, you may set a large value, e.g. 10000 to Maximum Position Lag Value, to address the error 17245 (0x435d) issue, see attached snapshot.

    Regards,
    Garrett

  • Garrett,

    I checked the links between variables and I set the lag distance to 10000.

    They are set correctly:

    but the motor still does not turn.-

    I don´t now what could it be.

    Regards,

    Marek.

  • We figured out that Encoder is giving us position, but in a very specific way. It shows only 90° and 270°.and the position is not processed elsewhere. The program motor control is running but only in open speed loop becouse if we run it in closed speed loop mode the code returns -1 while verifying some endat things.

     

  • Marek,

    Were you able to make progress?

    We only tested the application with encoder ROQ437. I would suggest you to try to get the same model and verify there is no any mechanic issue in your setup. We have never seen the '90° and 270° issues like you described.

    Regards,
    Garrett