Go to Post oooh tight leather bumpers...sexy! - Nuttyman54 [more]
Home
Go Back   Chief Delphi > Technical > Control System > FRC Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-04-2009, 09:52
hal_2498 hal_2498 is offline
Registered User
FRC #2498
 
Join Date: Jan 2009
Location: Minneapolis
Posts: 4
hal_2498 is an unknown quantity at this point
Using the cRIO to control custom lights

Hello! I am working on a non-competition robot which uses this year's cRIO as the control system. I would like to find a way to control the brightness of lightbulbs directly from the cRIO. This means I need to find a way to make the cRIO control the current through one of its outputs (or an ouptut on the ditigal sidecar).

Is this possible?
From what I've been trying to figure out, its not. It seems that every output is either ground, a constant (uncontrollable) 5V, or the signal which sends information by changing the voltage from ground to some constant for a specified length of time.

In the past I have used a victor motor controller to control lights, but it would save the team $75 (for a Jaguar) and give me more options if I could figure out how to do it using only the cRIO.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-04-2009, 09:54
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,766
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Using the cRIO to control custom lights

hal,
The Crio has limited output current capability in that it is designed to drive digital inputs. If you are wanting to vary brightness in LED or filament lamp strings, the speed controllers are the best way to do that.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-04-2009, 09:56
martin417's Avatar
martin417 martin417 is offline
Opinionated old goat
AKA: Martin Wilson
no team
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Buford, GA
Posts: 719
martin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond repute
Re: Using the cRIO to control custom lights

If you are using incandescent bulbs, I can't help you. But, if you are using LED's, you can just hook them up to the PWM outputs, or to to the digital outputs (if you use the digital outputs, you will have to write code to pulse them like PWMs to vary brightness). Be sure to check the current source max on the sidecar and compare to the current draw on the LED's
__________________
Former Mentor Team 1771
Former mentor Team 4509

Last edited by martin417 : 09-04-2009 at 09:58. Reason: spelling
Reply With Quote
  #4   Spotlight this post!  
Unread 09-04-2009, 10:11
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Using the cRIO to control custom lights

Quote:
Originally Posted by martin417 View Post
If you are using incandescent bulbs, I can't help you. But, if you are using LED's, you can just hook them up to the PWM outputs, or to to the digital outputs (if you use the digital outputs, you will have to write code to pulse them like PWMs to vary brightness). Be sure to check the current source max on the sidecar and compare to the current draw on the LED's
That's what I was thinking. You might want to put a cap in parallel to "smooth out" the pulses. If current draw becomes an issue, you can hook the digital output to a transistor (simple amplifier) and use another power source.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
Reply With Quote
  #5   Spotlight this post!  
Unread 09-04-2009, 09:57
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Using the cRIO to control custom lights

What type of light bulbs?

If you mean LEDs, you might be able to use the 9472 (slot 8).
Reply With Quote
  #6   Spotlight this post!  
Unread 09-04-2009, 10:18
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Using the cRIO to control custom lights

Some Electronic Speed Controllers are significantly less expensive than a Jaguar. (I've seen a circuit you can build with less than $15 in parts, though one of them is a PIC that needs to be programmed.)

Stepping out of the box for a moment, would a mechanical solution work? You could use a servo to open and close a shutter on an always-on lamp.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-04-2009, 11:06
martin417's Avatar
martin417 martin417 is offline
Opinionated old goat
AKA: Martin Wilson
no team
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Buford, GA
Posts: 719
martin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond repute
Re: Using the cRIO to control custom lights

Quote:
Originally Posted by Alan Anderson View Post
Stepping out of the box for a moment, would a mechanical solution work? You could use a servo to open and close a shutter on an always-on lamp.
Or, you could use that servo to control a potentiometer or SCR dimmer....
__________________
Former Mentor Team 1771
Former mentor Team 4509
Reply With Quote
  #8   Spotlight this post!  
Unread 09-04-2009, 11:56
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Using the cRIO to control custom lights

I'm with Eric. Use the 9472 relay module and PWM its outputs. Each output is rated for 750 milliamps and should be capable of switching at over 1kHz (ie faster than you can see).
Reply With Quote
  #9   Spotlight this post!  
Unread 09-04-2009, 12:06
Jeff Pahl's Avatar
Jeff Pahl Jeff Pahl is offline
likes to look at shiny things...
FRC #5148 (New Berlin Blitz)
Team Role: Engineer
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Waukesha, WI
Posts: 344
Jeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond reputeJeff Pahl has a reputation beyond repute
Re: Using the cRIO to control custom lights

Quote:
Originally Posted by Russ Beavis View Post
I'm with Eric. Use the 9472 relay module and PWM its outputs. Each output is rated for 750 milliamps and should be capable of switching at over 1kHz (ie faster than you can see).

You can parallel output channels on the 9472 up to a total of 6 A. Just make sure to switch all channels at the same time. The module is rated for a switching rate of up to 10 kHz.

However, rather than take a chance of blowing up a cRIO module that is much more expensive than a speed controller, I think I would probably use the cRIO to supply a PWM signal thru an optoisolator to a simple power transistor circuit to do the actual switching of the lighting load.
__________________
Team 5148 - 2014 Wisconsin Regional Rookie All-Stars!!

Mentor: 1379: 2004-2008 / 2530: 2008-2013 / 2861: 2009 / 5148: 2014-??
Lead Robot Inspector: 10,000 Lakes '09 - '11 / Lake Superior '11-'12 / Northern Lights '13, '15 - '16 / Championship '09 - '12, '14 - '15
Attending/Inspecting 2017: TBD, Wisconsin, STL Championship

"Sometimes the questions are complicated and the answers are simple" -Dr. Seuss
Reply With Quote
  #10   Spotlight this post!  
Unread 09-04-2009, 13:02
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Using the cRIO to control custom lights

Note that if you want to use PWM to control transistors or LEDs directly, you will have to write your own pulse code and use a digital output (whether signal outputs on the 9403 or driven outputs on the 9472). The PWM being output from the ports labelled PWM on the sidecar is an R/C standard servo control signal, which means the PWM duty cycle ("on time") will vary between about 7.5% and 12.5%, which means you'll barely be able to see an transister-controlled incandescent, and an LED probably won't turn on even at maximum output.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #11   Spotlight this post!  
Unread 09-04-2009, 13:55
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Using the cRIO to control custom lights

Quote:
Originally Posted by RyanCahoon View Post
...the PWM duty cycle ("on time") will vary between about 7.5% and 12.5%...
Slightly out of the box again: if you amplify a standard servo PWM signal to drive a suitable load at the right multiple of its rated voltage, you can end up running it at effectively 50 to 100 percent power.
Reply With Quote
  #12   Spotlight this post!  
Unread 09-04-2009, 14:13
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Using the cRIO to control custom lights

Very interesting concept, Alan!

Imagine taking a 100W light bulb (spec'd for 120VAC) but run it on a 240VAC output with only 25% duty cycle through some dimming/chopping circuitry. It's still 100W of average output but is actually 400W for 25% of the time if you look quick.

As another example, many motors or coils can actually be run at much higher voltages if you use a suitable set of power switches to PWM the "effective" voltage across the winding. Many stepper motors are often driven at MUCH higher voltages but use closed-loop current control to limit the "real" voltage that's applied. This is especially useful for providing snappier stepper motor response because you apply more torque/current faster when you've got more voltage available (but still limit the current to a safe threshold).

Russ
Reply With Quote
  #13   Spotlight this post!  
Unread 09-04-2009, 23:37
hal_2498 hal_2498 is offline
Registered User
FRC #2498
 
Join Date: Jan 2009
Location: Minneapolis
Posts: 4
hal_2498 is an unknown quantity at this point
Re: Using the cRIO to control custom lights

Wow, thanks for all the great responses, everybody!!

Here's a concept which I've come up with based off your advice. It uses a capacitor to "smooth" the current and voltage applied to the lights, and a transistor to protect the cRIO/Digital Sidecar from drawing too much current. Is this a good place to start? Thanks,
Attached Thumbnails
Click image for larger version

Name:	circuit-diag.png
Views:	98
Size:	40.5 KB
ID:	7812  
Reply With Quote
  #14   Spotlight this post!  
Unread 10-04-2009, 07:54
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,766
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Using the cRIO to control custom lights

Hal,
The RC network is not really needed but your LED string does need some series resistance to limit the current in the LEDs. Current to the base of the transistor is limited by the 10k pullup resistor in the DSC. To fudge the calculation I start with 2 volts per LED so on a 12 volt supply, that allow for 5 LEDs in series and a series resistor. Calculating 2 volts and 20 ma for the resistor gets you 100 ohms. In reality the LEDs are less than 2 volts but as the battery output drops, the LEDs will stay on.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #15   Spotlight this post!  
Unread 10-04-2009, 07:55
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Using the cRIO to control custom lights

The R and C on your schematic aren't doing anything really useful. You need to add a resistor between SIGNAL and the Base of your transistor.

You'll also need to triple check the specs for the transistor that you've selected and ensure a sufficiently high current-transfer ratio. For example, the transistor has a beta of 100 and you're trying to deliver 1A of current to the LEDs, you'll want to put at least 10 mA (1A/100) into the base of the transistor (by selecting the base resistor accordingly).

You'll probably also need to place a series resistor in your string of LEDs but it's possibly to let the transistor do that "work" for you.

You'll also need to consider heat dissipation. For example, with 1A in the LEDs and 2V LEDs, you'll have 4V across the transistor and/or current-limiting resistor. 4V * 1A = 4W!!! That's a lot of heat to remove (if you're using really strong LEDs, but you may not be dumping 4W continuously).

You could also consider using a FET instead of a BJT. In that case, you'll want a resistor to ground at the gate input to the FET (and maybe a small resistor into the gate).

Russ
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cRio keeps on staying red on the lab view conection test all other 4 lights are green bio hazard NI LabVIEW 2 11-03-2010 16:48
Using Sockets with the cRio in Wind River C222 C/C++ 15 17-02-2009 14:10
purchasing buying the 2009 NI cRIO control system martin417 FRC Control System 10 29-12-2008 12:31
Lights on the Control Panel Han Tzu Electrical 5 08-02-2005 13:30
Using Custom Inputs on the Controller Board schenkin Programming 10 27-01-2005 10:26


All times are GMT -5. The time now is 00:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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