Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi (http://www.chiefdelphi.com/forums/showthread.php?t=90952)

RyanN 04-02-2011 21:28

Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
5 Attachment(s)
Well, I've been busy tonight. See, I purchased some nice LED strips from SuperBrightLEDs.com (If you're an LED nerd, you probably should go look at it if you haven't already. I've had 3 or 4 orders from them and have been overly pleased by their service.)

Anyway, enough promoting them.

I purchased two of the RLBN-RGB30SMD RGB Narrow Rigid Light Bar that can be found on this page along with some other LED goodies. (Hmm... what else could we be doing with LEDs?).

Well, over the past two days at robotics, I've been making a PWM based control box to control each individual color channel, 6 in all (3/strip x 2 strips = 6). I finished building the control box just a few minutes before that session was over, so I never really got to go in deep with any programming with our programmer. We did verify that my box was working well with some simple on and off switches in LabVIEW.

Here are the VIs that just came in hot off of my mouse.

Underglow_Begin.vi (placed in the Begin.vi)
Attachment 9966

Underglow_Control.vi (placed in the 100ms loop in Periodic Tasks.vi)
Attachment 9967

Underglow_Close.vi (placed in Finish.vi)
Attachment 9968

If anyone wants the source code, here it is.
Attachment 9969

Anyway, so what's the point of this thread? Well I have a question regarding the WPI_DigitalOutputGeneratePWM.vi
Attachment 9970

It says that this VI will allocate 1 of 4 PWM generators. I'm guessing that means I can only have 4 of these in my Underglow_Control.vi? Maybe someone here who has used this control before can spread a little light on it?

Now I would use that handy WPI_PWMSetValue.vi, except that we only have 4 PWM channels free, plus the spacing and such between the PWM headers would make it more of a wiring hassle rather than just using the signal pins that I already have and using 1 PWM cable for each LED strip. Plus... we're using up 6 of the 10 PWM outputs, and we would rather not add an additional sidecar.

My only other idea is to combine both LED strips into 1 using a Y-cable and using 3 of the WPI_PWMSetValue.vi's unless I can truly use 6 of them (which I hope).

Let me know your thoughts, or if you have any questions about my project, just ask.

Greg McKaskle 04-02-2011 22:20

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Not knowing everything about the strip you bought, I have a few questions.

What color LEDs are you intending to use? If you only want blue strips, do you need more than two PWMs?

Another thing to consider is how much light you need. It is actually pretty easy to overdo it. The fabric is 600x brighter than white paint. Getting the LEDs near the camera lens is far more important than the brightness.

Greg McKaskle

RyanN 04-02-2011 22:38

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Greg McKaskle (Post 1015853)
Not knowing everything about the strip you bought, I have a few questions.

What color LEDs are you intending to use? If you only want blue strips, do you need more than two PWMs?

Another thing to consider is how much light you need. It is actually pretty easy to overdo it. The fabric is 600x brighter than white paint. Getting the LEDs near the camera lens is far more important than the brightness.

Greg McKaskle

This isn't for the lines on the floor. This is purely for decoration / looks. It's an RGB strip.

Joe Ross 04-02-2011 22:52

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by RyanN (Post 1015832)
Anyway, so what's the point of this thread? Well I have a question regarding the WPI_DigitalOutputGeneratePWM.vi
Attachment 9970

It says that this VI will allocate 1 of 4 PWM generators. I'm guessing that means I can only have 4 of these in my Underglow_Control.vi? Maybe someone here who has used this control before can spread a little light on it?

Now I would use that handy WPI_PWMSetValue.vi, except that we only have 4 PWM channels free, plus the spacing and such between the PWM headers would make it more of a wiring hassle rather than just using the signal pins that I already have and using 1 PWM cable for each LED strip. Plus... we're using up 6 of the 10 PWM outputs, and we would rather not add an additional sidecar.

My only other idea is to combine both LED strips into 1 using a Y-cable and using 3 of the WPI_PWMSetValue.vi's unless I can truly use 6 of them (which I hope).

Let me know your thoughts, or if you have any questions about my project, just ask.

PWMSetValue will output a servo style PWM signal, which is not what you want for your LEDs. WPI_DigitalOutputGeneratePWM.vi is new this year, and you might not find anyone who's used it before. Don't be afraid to experiment.

RyanN 04-02-2011 22:53

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Joe Ross (Post 1015868)
PWMSetValue will output a servo style PWM signal, which is not what you want for your LEDs. WPI_DigitalOutputGeneratePWM.vi is new this year, and you might not find anyone who's used it before. Don't be afraid to experiment.

Sounds good. I'll take a look at it tomorrow and report back. I do know for a fact that the DOs are not disabled when the robot is disabled.

Dfontana 04-02-2011 22:56

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Based on the name of the thread, I'm thinking that you're probably trying to create some ambient lighting underneath the robot's frame and not using this as a part of this year's vision system.

You have already pointed out your best option. You can drive them using the PWM generators for the DIO modules,but you will likely have to tie both strips together.

This may seem like a hassle, but in the end, it is probably the easiest to accomplish.

Alternatively, you may design and create a custom circuit to drive these. As our team is actually made up of a lot of students from the school's electronics class, this is probably the way we would go. You could use either a PIC or BASIC STAMP micro controller (Or any micro controller, really, though these are the ones I have experience with).

However, with this approach you could not change colors on-the-fly like you could if using labview with some virtual controls on the dashboard.

Dfontana 04-02-2011 23:03

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Joe Ross (Post 1015868)
PWMSetValue will output a servo style PWM signal, which is not what you want for your LEDs. WPI_DigitalOutputGeneratePWM.vi is new this year, and you might not find anyone who's used it before. Don't be afraid to experiment.

Is there a significant difference between the two?

RyanN 04-02-2011 23:10

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Dfontana (Post 1015875)
Based on the name of the thread, I'm thinking that you're probably trying to create some ambient lighting underneath the robot's frame and not using this as a part of this year's vision system.

You have already pointed out your best option. You can drive them using the PWM generators for the DIO modules,but you will likely have to tie both strips together.

This may seem like a hassle, but in the end, it is probably the easiest to accomplish.

Alternatively, you may design and create a custom circuit to drive these. As our team is actually made up of a lot of students from the school's electronics class, this is probably the way we would go. You could use either a PIC or BASIC STAMP micro controller (Or any micro controller, really, though these are the ones I have experience with).

However, with this approach you could not change colors on-the-fly like you could if using labview with some virtual controls on the dashboard.

My original idea was to use a PIC24, then use the PIC24 as an I2C Slave device and set it up that way... but with a full time job, then mentoring robotics for 20 hours a week, I simply do not have enough time to develop such a solution. We'll probably tie both together.

Joe Ross 04-02-2011 23:22

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Dfontana (Post 1015881)
Is there a significant difference between the two?

servo style PWM gives you a pulse width between 0.67 and 2.33 ms, repeated every 5, 10, or 20ms. You have a very limited range of duty cycles and frequencies. It's suitable for driving a servo or a speed controller, but not much else.

The digital output PWM lets you set a duty cycle between 0-100% and a frequency from 0.6hz to 19khz.

porterma64 05-02-2011 00:03

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
One thought for use of robot underglow is driver/alliance feed back. The driver will more than likely use this to tell if a lifter is in position. Maybe different colors desginate different lifter levels or signaling to the feeder stations what tube(s) to dispense. There are a lot of good ideas with this. Our team has been entertaining these ideas, but has not been high on the priority list. I hope to see if we can get it to work and let you know.

Mike Porter
FRC 815 Advance Power

Matt Krass 05-02-2011 00:21

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Joe Ross (Post 1015900)
servo style PWM gives you a pulse width between 1.67 and 2.33 ms, repeated every 5-20ms. You have a very limited range of duty cycles and frequencies. It's suitable for driving a servo or a speed controller, but not much else.

The digital output PWM lets you set a duty cycle between 0-100% and a frequency from 0.6hz to 19khz.

Wouldn't that be 0.67 ms and 2.33 ms? Or am I just getting sleepy?

WizenedEE 05-02-2011 01:36

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Matt Krass (Post 1015946)
Wouldn't that be 0.67 ms and 2.33 ms? Or am I just getting sleepy?

Wikipedia says standard servos go from about 1.25 to 1.75ms, so it makes sense the digital sidecar can do more than that (duh :p)

To the OP, what are you using to control the LEDs? FETs? Spikes? Victors?

RyanN 05-02-2011 07:29

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by WizenedEE (Post 1015974)
Wikipedia says standard servos go from about 1.25 to 1.75ms, so it makes sense the digital sidecar can do more than that (duh :p)

To the OP, what are you using to control the LEDs? FETs? Spikes? Victors?

Two 2N2222 in the T092 package per channel. Ours are rated for 800mA each, so we have 1.6A of capability. I put in two to handle heat dissipation a little better. The weakest link in our box is the 12V regulator, rated for only 1A.

I'm not 100% sure of the current of each bar for each channel. We may have to bump it up to 2 or 3 voltage regulators, or we could drop the voltage regulator completely because of the fact that the RGB bar is pretty rugged.

arizonafoxx 05-02-2011 08:18

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
I am wondering why you want to use PWM. Are you trying to get a color in between RGB YCM W? If you are just looking for the 7 basic colors couldn't you just use digital IO Out to drive the base of your transistors and then have power and ground come from the PD board? If I am thinking correctly this would be legal and fused at 20A.

P.S. Our team bought one of these flex strips as well. I like the fact that you can cut the bars in sections and just add wires to increase number of strips you have.

Greg McKaskle 05-02-2011 09:12

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Silly me. I thought these were for illuminating the retroreflective strips on the columns and grids.

Greg McKaskle

Joe Ross 05-02-2011 09:58

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
Quote:

Originally Posted by Matt Krass (Post 1015946)
Wouldn't that be 0.67 ms and 2.33 ms? Or am I just getting sleepy?

You are correct, I edited my post.

RyanN 05-02-2011 21:53

Re: Underglow LED Control using WPI_DigitalOutputGeneratePWM.vi
 
1 Attachment(s)
Quote:

Originally Posted by arizonafoxx (Post 1016015)
I am wondering why you want to use PWM. Are you trying to get a color in between RGB YCM W? If you are just looking for the 7 basic colors couldn't you just use digital IO Out to drive the base of your transistors and then have power and ground come from the PD board? If I am thinking correctly this would be legal and fused at 20A.

P.S. Our team bought one of these flex strips as well. I like the fact that you can cut the bars in sections and just add wires to increase number of strips you have.


We wanted to control the color in the RGB spectrum.

This might give you an idea.

Attachment 9987

By the way, we never got to testing it today. We got busy doing other stuff, and this is very low priority.


All times are GMT -5. The time now is 23:46.

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