How to communicate with a EtherCAT device in KRL

  • Spec

    KR C4 / KSS V8.3.42 / WorkVisual 6.0

    KR300 R2500 with a linear rail(E1)

    Stepper Motor: Oriental Motor DGM200 and its EtherCAT-compatible driver AZD-CED

    My goal

    I want to do hot-wire cutting with the robot, and I need a turntable to rotate the workpiece. I bough a third-party stepper motor with a EtherCAT-enabled driver, trying to make a turntable by myself.


    Requirement

    I'll do the cutting only when the turntable is stationary, so the motor don't have to work synchronously with the robot axes.


    My approach

    I add a new Kuka motor as a simulated and asynchronous axis (E2) in WoV, and I plan to map E2 to some sort of KRL/SPS/EtherCAT things to command the external motor to rotate.


    What have been done so far

    I can jog the motor with the setting software provided the vendor, but it is done by GUI and a USB cable, no EtherCAT thing is involved. Also, the jogging is done on a common laptop, and the robot controller can't interact with it.


    I imported the ESI file and add it to the topology, and the motor is wired drive accordingly. Also, the CANopen over EtherCAT is giving me some values. The teach-pendant show no error so far, and the LED light on the motor driver indicates the the EtherCAT communication is "operational".

    My next step and question

    In this post, Skyefire said

    Quote

    But assuming you can get a connection, you can send any data over any FieldBus using KRL.


    I guess my next step is to find out which KRL syntax to send a message to a EtherCAT device. Then I can start try and error to compose the correct format of operation command.


    My question is, am I on the right track? If so, which KRL I should look into? I'm currently looking at CWRITE but its manual doesn't mention anything about field bus, X44, or EtherCAT, nor do the EtherCat Manual for KSS 8.3-8.4 provide any syntax example.


    I studied in architecture, having no background knowledge of mechanical or electrical engineering. My approach, my assumption, and my question could be terribly wrong. Any hint that can help me to narrow down things to read and try will be very appreciated.

  • Nation

    Approved the thread.
  • KUKA Ethercat protocal doesnt support SOE(Servo over Ethercat), if you still want to control your own driver over Ethercat, you have to build your own library. About the mapping in workvisual, it wont allow you edit the PDO(position, speed, acceleration,...), you need to change the xml file of your driver then import to Wov. Furthermore, it might have problem with byte swapping when mapping over 2 bytes, just need to check value received from robot and value shown on the driver manufacturer software.

    Edited once, last by Ben014 ().

  • Thank you huythai for your reply,

    Somehow I managed to operate the motor with KRL.

    Currently, I use lots of SIGNAL, WAIT SEC and WAIT FOR, so the latency add up. But it has fulfilled the requirement I need.

    I still have many things to learn, like SOE, PDO, and editing ESI. Once I have sorted these things out, I'll put a simple instruction of how I have done these. Hope that will help newbies like me.

  • Start WoV without any project open, then use Menu File, Import/Export, device description file, navigate to file you want imported... And if file does not show up, change filter...

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Thank you huythai for your reply,

    Somehow I managed to operate the motor with KRL.

    Currently, I use lots of SIGNAL, WAIT SEC and WAIT FOR, so the latency add up. But it has fulfilled the requirement I need.

    I still have many things to learn, like SOE, PDO, and editing ESI. Once I have sorted these things out, I'll put a simple instruction of how I have done these. Hope that will help newbies like me.

    I am beginning to implement the same thing. I have connected 4 JMC Jasd7502 EC Servo drives to a KRC4 robot. They are installed with a working ESI. I can exchange IO between servos and Robot.

    These servos will open and close a gripper to variable positions.
    I am thinking of writing a KRL file with signals etc... to initialize drive, home, set target position and move.
    Did your method work? could you share your KRL file? how bad is the latency?

  • I am beginning to implement the same thing. I have connected 4 JMC Jasd7502 EC Servo drives to a KRC4 robot. They are installed with a working ESI. I can exchange IO between servos and Robot.

    These servos will open and close a gripper to variable positions.
    I am thinking of writing a KRL file with signals etc... to initialize drive, home, set target position and move.
    Did your method work? could you share your KRL file? how bad is the latency?

    Hi Nicolas,


    Here is my code,


    This script did the job although I haven't refactored it to make it more concise.
    I never measure the latency since it's not a time-critical project.

    I hope this can be helpful, and any advice is very welcome!

  • In case this can help someone. I made 3 programs for my servos; Init, move to, reset. and sharing them below. (the program is for 4 servos that comply with Cia402 spec)


    PS; did you have a problem with Distributed clock synchronization? Work visual won't build the application if I turn DC-synchron on.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now