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

Sending RGB signals to LED source

  • mandem
  • October 12, 2020 at 1:08 PM
  • Thread is Unresolved
  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 1:08 PM
    • #1

    Hi, I have a KRC4 Compact and want to send 'on / off' and 'change colour' instructions to a programmable LED.

    Hoping for some advice as I am pretty lost with it all.

    Arduino hardware seems pretty widely used in the use of programmable LEDs. I've read elsewhere on this forum that in order to send a signal from the KRC4 to Arduino I'd need an octocoupler to isolate the circuits. Can anyone verify this and / or recommend a suitable hardware setup?

    I think the bigger issue is the colour changing aspect. can anyone simplify in programming terms how to send an output signal from the KRC4 that will turn the LED on and change it to a specific colour?

  • Online
    MOM
    Reactions Received
    175
    Trophies
    7
    Posts
    1,419
    • October 12, 2020 at 2:33 PM
    • #2

    The krc is normally working with 24DC while the Arduino works with 5 VDC.

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • October 12, 2020 at 2:43 PM
    • #3

    Most of the "programmable" LEDs rely on SPI communications, which uses some extensive Arduino libraries, which are not available for industrial robots.

    Establishing a serial connection from the robot to an Arduino could be difficult -- KRC4s don't have serial ports.

    OTOH, connecting normal I/O on the KRC (what I/O does your KRC have?) to the Arduino's I/O should be a simple matter of dealing with the voltage mismatch. Relays or a set of properly-wired transistors would do the job, but some properly-chosen optocouplers are probably the best and most reliable choice. Also the safest, almost eliminating the chance of a wiring mistake frying part of your hardware.

    At that point, you're using the Arduino as an intermediary -- the Arduino has the complex communication libraries for running the LEDs, and your application program "listens" to the GPIO inputs from the KRC and sends commands to the LEDs accordingly.

    It's a tad kludgey, but probably the approach with the lowest technical risk.

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 2:46 PM
    • #4
    Quote from MOM

    The krc is normally working with 24DC while the Arduino works with 5 VDC.

    Thanks for confirming - I think this is what the octocoupler is for that I mentioned in op. This github reop recommends it but I think the readme is incomplete - https://github.com/fablabbcn/KUKAIO

    I am more confused about how to send an output signal from the KRC4 that specifies a colour for the Arduino to send to the LED

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • October 12, 2020 at 2:48 PM
    • #5

    Well, first, you have to determine what I/O your KRC has (and, in fact, what model KRC you have). KRC4s, for example, have no I/O by default -- it's entirely optional. KRC2s came with DeviceNet by default, but that still required adding DeviceNet slave nodes to the robot in order to break out the DN I/O into individual hardware signals.

  • DannyDJ
    Reactions Received
    62
    Trophies
    6
    Posts
    493
    • October 12, 2020 at 2:54 PM
    • #6

    Maybe you can use EK1100 EtherCat Coupler and EL6001 RS232 terminal from Beckhoff if you want the serial communcation from KRC4...

    I'm using just right now the EL6021 RS485 and sending and receiving data from and to PC(USB to Serial adapter)...

    https://www.beckhoff.com/EL6001/

  • Online
    MOM
    Reactions Received
    175
    Trophies
    7
    Posts
    1,419
    • October 12, 2020 at 3:14 PM
    • #7

    For Arduino there are also EtherCAT modules available

    For instance

    https://www.bausano.net/en/hardware/et…no/easycat.html

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 3:16 PM
    • #8
    Quote from SkyeFire

    Well, first, you have to determine what I/O your KRC has (and, in fact, what model KRC you have). KRC4s, for example, have no I/O by default -- it's entirely optional. KRC2s came with DeviceNet by default, but that still required adding DeviceNet slave nodes to the robot in order to break out the DN I/O into individual hardware signals.

    I have the KRC4 Compact RAL 7016

    IOs are Beckhoff EK1100, EL1809, and EL2809

    https://ibb.co/1Rp2FHW

    https://ibb.co/Jp34g02

    https://ibb.co/xg5dHzx

    Quote from DannyDJ

    Maybe you can use EK1100 EtherCat Coupler and EL6001 RS232 terminal from Beckhoff if you want the serial communcation from KRC4...

    I'm using just right now the EL6021 RS485 and sending and receiving data from and to PC(USB to Serial adapter)...

    https://www.beckhoff.com/EL6001/

    Thanks, I'll look into this

  • Online
    MOM
    Reactions Received
    175
    Trophies
    7
    Posts
    1,419
    • October 12, 2020 at 3:40 PM
    • #9

    There is also an us manufacturer

    https://www.esmacat.com/ease

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 3:47 PM
    • #10
    Quote from MOM

    For Arduino there are also EtherCAT modules available

    For instance

    https://www.bausano.net/en/hardware/et…no/easycat.html

    Would this make it easier to send data from the pre installed modules to the Arduino?

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • October 12, 2020 at 4:04 PM
    • #11

    and what is the type of LED strip you are working with? what are electrical specs?

    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

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • October 12, 2020 at 4:09 PM
    • #12

    How many unused outputs do you have on those BL modules? How many different commands do you need to send from the KRC to the Arduino?

  • Online
    MOM
    Reactions Received
    175
    Trophies
    7
    Posts
    1,419
    • October 12, 2020 at 4:26 PM
    • #13

    @SkyFire

    are you talking to me?

    The easycat shield is an ethercat slave and have EtherCAT® 32 byte in input and 32 byte in output, configurable up to 128 byte

    The krc would just write to an output

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 4:51 PM
    • #14
    Quote from panic mode

    and what is the type of LED strip you are working with? what are electrical specs?

    I'm looking at this LED but open to other options, as long as it is bright (variable brightness preferred), and can change colour - https://www.adafruit.com/product/1260

    Specs are:

    • 0.5" (12.5mm) diameter circle PCB, 0.1" (2.5mm) total thickness
    • 800 KHz speed protocol
    • Chainable design
    • 5-9VDC power (can run at 3.5V but color will be dimmed), constant current 18.5mA per LED (~55mA max total per pixel)
    Quote from SkyeFire

    How many unused outputs do you have on those BL modules? How many different commands do you need to send from the KRC to the Arduino?

    As far as I can tell all of them are available - it looks like they lead to an X12 port on the exterior of the KRC4 Compact. Pic here - https://ibb.co/xg5dHzx

    I'd like to send as many commands as possible but happy to work with 16 if that's all the IO will allow.

    I gather I would have to set variables ahead of time in Arduino ahead of time for the colours I'd like to use, rather than send a signal that sets the LED to any of the 256*256*256 RGB colours spontaneously.

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • October 12, 2020 at 4:57 PM
    • #15

    it all depends on what you really want to accomplish...

    there are LED strips for different voltages and using various type of LEDs.

    some LED strips are using communication to get individual LEDs programmed to particular color. in this case you will need something like an Arduino that can talk to them. driving them directly from KRC I/O is not going to work.

    but most of the RGB strips (cheaper ones) are bussed. this means that all LED segments of same color are grouped together. no individual LED control is possible, you control entire channel together and controller output need to be able to handle the current (the longer the strip, the more LEDS.... the more LEDs the more current). also they are designed for NPN, meaning that channel is lit when pulled low. note that KRC outputs are usually PNP style. this can be sorted out by using relay or suitably biased transistor per channel. optocouplers cannot handle much current, so it would need to their biffed up cousin SSR (solid state relay). or even regular electromechanical relay if you don't mind noise and slower switching speed. if using SSRs, read the specs and check voltage drop for example. if using electromechanical relays, also read specs and check switching time and wiping current.

    if you use this and simply wish to to turn on/off one of channels, this can be done directly from KRC, just need proper signal matching. using relay per channel will do just fine, so for RGB you would need three relays. for RGBW you would need 4 relays. nice thing about this is that relay contacts are isolated from KRC outputs so LED strip can be operating at any voltage, you just need separate power supply for it. you can turn more than one channel at once to get certain (fixed) color mix but... you cannot dial in arbitrary color. that would require PWM and robot outputs are not fast enough for making this flicker free.

    if you need to control the colors (get particular orange for example) or do animation (colors gradually change from one to another) you have no choice but using something that can ensure proper (sufficiently fast) timing. then the option of adding EtherCat shield to an Arduino is the way to go. KRC can specify whatever it wants and Arduino would receive signals and turn them into something that LED strips need - be it PWM, communication or just turning on/off.

    EDIT,

    just saw your response. to get color and brightness change you will need to use Arduino and EtherCat shield to interface this to a robot.

    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

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • October 12, 2020 at 5:13 PM
    • #16

    So, you have a KRC4 Compact with the X12 option, then?

    16 outputs -- how many GPIOs does your Arduino have? They come in different flavors.

    With 16 bits, you could encode 65535 different states. IIRC, the Arduino library for those LED strips uses 3 8bit values -- one each for the intensity of Red, Green, and Blue. So you'll have to lose some resolution, but that shouldn't be a big issue.

    Your Arduino program could, for example, monitor GPIO 1-5, and convert that into an 8bit Red value. Ditto for GPIO 6-10 for the Green, and GPIO 11-15 for the Blue. The math would be Color Intensity = GPIO Value / 31 * 255.

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 5:20 PM
    • #17
    Quote from panic mode

    it all depends on what you really want to accomplish...

    there are LED strips for different voltages and using various type of LEDs.

    some LED strips are using communication to get individual LEDs programmed to particular color. in this case you will need something like an Arduino that can talk to them. driving them directly from KRC I/O is not going to work.

    but most of the RGB strips (cheaper ones) are bussed. this means that all LED segments of same color are grouped together. no individual LED control is possible, you control entire channel together and controller output need to be able to handle the current (the longer the strip, the more LEDS.... the more LEDs the more current). also they are designed for NPN, meaning that channel is lit when pulled low. note that KRC outputs are usually PNP style. this can be sorted out by using relay or suitably biased transistor per channel. optocouplers cannot handle much current, so it would need to their biffed up cousin SSR (solid state relay). or even regular electromechanical relay if you don't mind noise and slower switching speed. if using SSRs, read the specs and check voltage drop for example. if using electromechanical relays, also read specs and check switching time and wiping current.

    if you use this and simply wish to to turn on/off one of channels, this can be done directly from KRC, just need proper signal matching. using relay per channel will do just fine, so for RGB you would need three relays. for RGBW you would need 4 relays. nice thing about this is that relay contacts are isolated from KRC outputs so LED strip can be operating at any voltage, you just need separate power supply for it. you can turn more than one channel at once to get certain (fixed) color mix but... you cannot dial in arbitrary color. that would require PWM and robot outputs are not fast enough for making this flicker free.

    if you need to control the colors (get particular orange for example) or do animation (colors gradually change from one to another) you have no choice but using something that can ensure proper (sufficiently fast) timing. then the option of adding EtherCat shield to an Arduino is the way to go. KRC can specify whatever it wants and Arduino would receive signals and turn them into something that LED strips need - be it PWM, communication or just turning on/off.

    EDIT,

    just saw your response. to get color and brightness change you will need to use Arduino and EtherCat shield to interface this to a robot.

    Display More

    Thanks, this is useful though might take another read to fully get my head around.

    I actually emailed a couple of etherCAT shield manufacturers an hour ago for their advice on 1) wether it would work and 2) setup recommendations.

    For the moment I only need to use one LED so in this case would I get any benefit from using a SSR over an optocoupler?

  • mandem
    Trophies
    3
    Posts
    47
    • October 12, 2020 at 5:27 PM
    • #18
    Quote from SkyeFire

    So, you have a KRC4 Compact with the X12 option, then?

    16 outputs -- how many GPIOs does your Arduino have? They come in different flavors.

    With 16 bits, you could encode 65535 different states. IIRC, the Arduino library for those LED strips uses 3 8bit values -- one each for the intensity of Red, Green, and Blue. So you'll have to lose some resolution, but that shouldn't be a big issue.

    Yes, it came with a plug by pack kit for the X12

    I haven't bought the Arduino yet, do you have any recommendations?

    65535 should be plenty!

    Quote

    Your Arduino program could, for example, monitor GPIO 1-5, and convert that into an 8bit Red value. Ditto for GPIO 6-10 for the Green, and GPIO 11-15 for the Blue. The math would be Color Intensity = GPIO Value / 31 * 255.

    Thanks for this!

  • Mentat
    Reactions Received
    61
    Trophies
    5
    Posts
    243
    • October 12, 2020 at 5:29 PM
    • #19

    You could also trade off some time resolution for color resolution, some bonus fun time to figure out the protocol to use :smiling_face:

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • October 12, 2020 at 5:30 PM
    • #20

    not bad... that would eliminate need for EtherCat shield but would still need interface from X12 to Arduino.

    if isolation is needed, bunch of optocouplers would be needed (and resistors).

    one can also transfer the color values one at a time to keep higher resolution and save on I/O

    For example use 8 bits for value and three more to identify RGB color...

    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

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

Similar Threads

  • I/O Communication problem wiith PLC

    • Dalin
    • September 27, 2018 at 9:23 PM
    • Kawasaki Robot Forum
  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