Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   RGB LED Lights (http://www.chiefdelphi.com/forums/showthread.php?t=152787)

ABreyen 22-12-2016 09:01

RGB LED Lights
 
Hey CD! Our team bought these RGB LED Light Strips from AndyMark. Has anyone worked with something like a Raspberry Pi or Arduino to control them? I'm guessing the GPIO Pins on the rPi would work somehow? We might have to convert the 12V LEDs to 5V or something?

Also, is it possible to use the RoboRio to display the Alliance Color if we used these on the robot? I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?

We were possibly thinking of somehow using our DriverStation to provide 5V Power on our control board. Would this be possible if we used a 5V -> 12V converter? On the board is where we probably would use a Raspberry Pi or Arduino.

Thank you!!

bobbysq 22-12-2016 09:14

Re: RGB LED Lights
 
Quote:

Originally Posted by ABreyen (Post 1622906)
I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?

Who told you that? Please tell them to read the manual.

Use of these is fully legal, as long as you don't plug them into motor controllers. For these LEDs, I would recommend using a relay with an Arduino to turn them on and off. Since they're by channel instead of individually addressable, you'll turn on a channel by turning one of the relays on.

As for getting the alliance color, WPILib provides a DriverStation API that can tell you what alliance you're currently on. You can then pass this on through I2C, serial, or SPI to the Arduino.

ABreyen 22-12-2016 09:19

Re: RGB LED Lights
 
My bad... Yup in section 4.10, R56, it is legal
Quote:

There are no rules that prohibit co-processors, provided commands originate from the roboRIO to configure, enable, and specify all operating points for all power regulating devices. This includes motor controllers legally wired to the CAN-bus.
So do most people use an Arduino? What kind, and does anyone have code to do this?

On the robot, can we use the 12V from the battery?

jweston 22-12-2016 09:44

Re: RGB LED Lights
 
We've used FastLED in the past with success. Power comes through the Arduino so your power source whatever is powering that. We powered ours by plugging it into the RoboRIO's USB although our comm was done over I2C with the built-in Wire Library.

One thing to watch out for if you're doing comm and light updates semi-concurrently is how to wait correctly. If you need to hold a light pattern, don't use millis(). It interferes with retrieving comm data. Use elapsedMillis instead.

Billfred 22-12-2016 09:54

Re: RGB LED Lights
 
Quote:

Originally Posted by ABreyen (Post 1622906)
Hey CD! Our team bought these RGB LED Light Strips from AndyMark. Has anyone worked with something like a Raspberry Pi or Arduino to control them? I'm guessing the GPIO Pins on the rPi would work somehow? We might have to convert the 12V LEDs to 5V or something?

Also, is it possible to use the RoboRio to display the Alliance Color if we used these on the robot? I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?

We were possibly thinking of somehow using our DriverStation to provide 5V Power on our control board. Would this be possible if we used a 5V -> 12V converter? On the board is where we probably would use a Raspberry Pi or Arduino.

Thank you!!

Hi, Billfred from AndyMark. Let's tackle a few things in no particular order:
  • The prohibitions on Raspberry Pi or Arduino boards is in FIRST Tech Challenge, not the FIRST Robotics Competition. We brought these LEDs to market in particular because you could just hook up 12V and go.
  • These LEDs aren't individually addressable--they all show the same color, based on the voltages applied.
  • You could try to convert 5V to 12V, but I would highly recommend using a separate battery pack for driver station lights. Any unnecessary electrical loads on the Driver Station, to me as a mentor and coach, is tempting fate.
  • If you just want red, green, or blue, it's just a matter of grounding that channel by wiring them straight in the PDP. Purple? Ground red and blue. White? Ground all three. For more precise mixing, you'd need a controller or a bunch of resistors. Speed controllers would work, or one of the thousands of off-the-shelf LED controllers if it met (or was made to meet) the no-wireless-communication rule.
  • As always, read the electrical rules and the custom circuit rules in particular next year to make sure your application is compliant.

GeeTwo 22-12-2016 10:04

Re: RGB LED Lights
 
We used a similar string of LEDs to show alliance colors in 2015, using spike relays controlled directly from the RIO. See this post for the details.

arichman1257 22-12-2016 10:13

Re: RGB LED Lights
 
In 2016 we used those on our bot. We used the FastLED library on an arduino to send them the signals. But we also sent the arduino PWM signals to tell the arduino what color to display. The driver station has a way to get your alliance color and we sent that to the arduino for that purpose. But mainly we had a rainbow animation on them which is this video. If you want to know more DM me and I'll put you in contact with the person who wrote the code and developed the system for it. :)

GreyingJay 22-12-2016 11:03

Re: RGB LED Lights
 
Quote:

Originally Posted by ABreyen (Post 1622910)
On the robot, can we use the 12V from the battery?

Yes, you could pull a run directly from a PDP breaker, or wire something off the VRM (and you can add a second VRM if needed for this purpose), or you could even use a solenoid relay from the PCM assuming you're using 12 volt pneumatics and not 24 volt.

Last year on our robot our green LED ring light for autonomous vision processing was powered from the PCM, since our VRM outputs were used by other devices (we had a webcam, and a Raspberry Pi running the webcam and vision processing software, and a D-Link gigabit network switch on board since the OpenMesh radio only has two available ports). This also lets you turn it on and off in software, whereas the VRM output is always on.

As a cheap and easy way to set up LED lights (non addressable, non controllable) we were looking at IKEA DIODER light strips. We would have run these off a PCM relay output or VRM output.

BenBernard 22-12-2016 18:31

Re: RGB LED Lights
 
We run our RGB strips, ringlight, and targetting flashlight off of the roborio using PWM and a mosfet circuit based on a sample from adafruit. Very clean and simple.

Here's the adafruit link: https://learn.adafruit.com/rgb-led-strips/usage

Here's the rough circuit design. The green blocks are terminals.

jlindquist74 29-12-2016 23:19

Re: RGB LED Lights
 
In 2015 we had common-anode LED strips on the forklift verticals, and drove them through MOSFETs connected to the RoboRIO PWM ports. (We switched to CAN bus Talon SRXes, so our PWMs were totally unused.)

We were reminded (the hard way) that the PWM ports are shut off as part of the safety interlock when the robot is disabled. The plan in 2016 was to use the Adafruit I2C PWM driver instead, assuming the I2C port isn't shut off when disabled.


All times are GMT -5. The time now is 08:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi