1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Weird serial problem

  • chocobo_ff
  • August 11, 2013 at 8:51 PM
  • Thread is Resolved
  • chocobo_ff
    Trophies
    3
    Posts
    32
    • August 11, 2013 at 8:51 PM
    • #1

    I'm trying to communicate with our KRC2 via serial, sending position commands and sending back acknowledgement upon receiving them, but have been having a weird issue which I can't figure out. For the strings I send from MATLAB from another PC, there are 2 integers at the beginning of the string telling the KUKA what sort of move is required (PTP, LIN, CIRC), followed by (x,y,z,a,b,c), and (s,t) if it's a PTP, e.g. "0 0 x y z...", or "1 1 x y z ...". The problem is sometimes, the "0 0 " or "1 1 " (the type of moves) do not get received properly on the KUKA side. Looking at telnet on the KUKA (photo attached), sometimes this is received as " 00", " 0", "0 " etc (note the white spaces in the string).

    I have checked the MATLAB side, it seems to be sending the strings fine, I don't think the KUKA program is the issue, because the issue is with the incoming string and not the actual processing of it. It's also strange that this only happens in the first few characters of the string, so I doubt it's to do with the serial cable, but we are checking on that now.

    Any insights would be much appreciated :icon_smile:

    EDIT: in the image attached, the first received string is the correct format, the second one is messed up - it should read "0 0 -197..." instead of " 00-197..."

    Images

    • 2013-08-09 11.09.31.jpg
      • 2.15 MB
      • 4,000 × 2,250
      • 45

    Files

    2013-08-09 11.09.31.jpg_thumb 23.95 kB – 23 Downloads
  • Online
    SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,427
    • August 12, 2013 at 11:24 PM
    • #2

    Hm. That doesn't ring any bells. My first thought is to try using a non-whitespace delimeter, like commas, between each value. See what affect that has. It shouldn't matter, since the ASCII value for a "space" is not zero, but it's the only thing that comes to mind right off.

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • August 12, 2013 at 11:37 PM
    • #3

    Yea I'm not sure if comma instead of whitespace is going to make any difference, like you said whitespace is just another ASCII character, plus sometimes it's the 0, 1 or 2 that we use to represent the different states that are missing.

    We tried using a serial splitter to listen on the data coming out from the PC, and when the KRC2 is not receiving the proper string, the second laptop we use to check the data is receiving it fine...

    Not sure if this is of any help, but the setting in serial.ini is below:

    Code
    [COM3]
    
    
    BAUD=9600
    CHAR_LEN=8   ; 7,8
    STOP_BIT=1   ; 1,2  at time not changeable
    PARITY=2     ; EVEN=2, ODD=1, NONE=0
    PROC=4       ; 3964R=1, SRVT=2, WTC=3, XONXOFF=4
    
    
    [XONXOFF]
    CHAR_TIMEOUT=50      ; msec   Timeout after last received character
                         ;        to recognize the end of telegram
    MAX_TX_BUFFER=5      ; 1..5
    MAX_RX_BUFFER=20     ; 1..20
    SIZE_RX_BUFFER=2048  ; 1..2048 longest expected telegram length + 15 characters
    XON_VAL=17           ; 0..255  XON  character (decimal)
    XOFF_VAL=19          ; 0..255  XOFF character (decimal)
                         ; if XON_VAL=0 and XOFF_VAL=0 then XON/XOFF protocol
                         ; is disabled (pure serial communication)
    DSR_LINE=0           ; 0 = DSR line not connected, 1 = DSR line must be high
    Display More
  • Online
    SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,427
    • August 13, 2013 at 3:22 PM
    • #4

    Hm. You could try different parity settings. And I don't recall ever using any XON/OFF_VAL values other than zero.

    That is deuced odd, though. It doesn't look like a buffer issue. But the Telnet diagnostics read out the raw UART buffer, which makes it really look like the character is getting dropped before it gets to the robot. I have a hard time believing it's a UART bug...

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • August 13, 2013 at 8:33 PM
    • #5

    Did some more tests, it looks like the problem might be with MATLAB. Currently my MATLAB program sends a position when required, and polls for incoming data using a timer. When I removed the timer and hence polling for incoming data, the problem seems to go away. This leads me to think that maybe the incoming/outgoing parts of the code are clashing with each other (not something I expected from MATLAB).

    EDIT: tested with a serial splitter, data shows up fine on a 2nd PC when characters are dropped in the packet received by the KUKA...

    Edited once, last by chocobo_ff (August 14, 2013 at 8:41 PM).

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download