Go to Post Machinery tends to make chips fly into weird places. Lathes and mills are particularly good at this, though drill presses are skilled as well. - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2011, 19:02
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
Individual Control of Each Spike output ?

Is it possible to individually control each output line of the spike so you could independently turn on & off 2 leds ? At this point I know you can turn both off or turn one on but that will automatically turn the other one off (and visa versa).
  #2   Spotlight this post!  
Unread 03-03-2011, 19:13
Vikesrock's Avatar
Vikesrock Vikesrock is online now
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Individual Control of Each Spike output ?

It is possible. How you do it depends on the programming language being used. In Labview the Enum used for the Relay set can be set to "Off" (both off) "On" (both on), "Forward" (one on, one off) or "Reverse" (opposite of forward).
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #3   Spotlight this post!  
Unread 03-03-2011, 21:38
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 358
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Individual Control of Each Spike output ?

To do that you have to wire one LED to each spike output and the other end of each to ground (don't forget current the limiting resitor). Turning on the spike forward would light one LED, reverse would turn off the other.
__________________
Brian K
Team 1225 Robotics Mentor
  #4   Spotlight this post!  
Unread 03-03-2011, 22:27
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
Re: Individual Control of Each Spike output ?

Hi

We program in Java. Unfortunately the last time I programmed was with the CPU (RC) prior to the CRio (and in C++) so I don't have much (any) experience with the Relay class in WPI Lib

Here's an example of what we want to do with one spike.

On one line have an (12v) Red LED connected and be able to turn it on and off without effecting the state of what is on the other line of the spike. On the other line, we want to have a white 12v led that we flash in software, again, not effecting the Red LED.

I guess I really should have posted this in programming.
  #5   Spotlight this post!  
Unread 04-03-2011, 07:28
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Individual Control of Each Spike output ?

Code:
        myRelay.setDirection(Relay.Direction.kBoth);
        
        myRelay.set(Relay.Value.kOff); // M+ and M- = 0V
        myRelay.set(Relay.Value.kForward); // M+ = 12V, M- = 0V
        myRelay.set(Relay.Value.kReverse); // M+ = 0V, M- = 12V
        myRelay.set(Relay.Value.kOn); // M+ = 12V, M- = 12V
Wire as per instructed in posts above with grounds of your LED directly to power distribution.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
  #6   Spotlight this post!  
Unread 04-03-2011, 08:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Individual Control of Each Spike output ?

Quote:
Originally Posted by de_ View Post
Here's an example of what we want to do with one spike.

On one line have an (12v) Red LED connected and be able to turn it on and off without effecting the state of what is on the other line of the spike. On the other line, we want to have a white 12v led that we flash in software, again, not effecting the Red LED.

I guess I really should have posted this in programming.
The two processes will have to cooperate to achieve what you want.

Let the 4 possible states of the Spike be:

1) both LEDs OFF
2) White LED OFF, Red LED ON
3) White LED ON, Red LED OFF
4) both LEDs ON

Then, to flash the Red LED on/off while the White one is OFF, you would alternate between states 1 & 2.

But to flash the Red LED on/off while the White one is ON, you would alternate between states 3 & 4.

So the process which flashes the Red LED cannot act independently from the process which flashes the White LED, and vice-versa. The processes must share information.

One way to do this would be to have each process just set a boolean flag to indicate whether its LED should be ON or OFF, and let a third process set the proper state of the Spike each time either of these booleans changes. Rather than having the third process chew up resources polling, you could use some sort of messaging supporting by the vxworks OS.



  #7   Spotlight this post!  
Unread 04-03-2011, 09:57
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Individual Control of Each Spike output ?

Quote:
Originally Posted by Mr. Lim View Post
Code:
        myRelay.setDirection(Relay.Direction.kBoth);

        myRelay.set(Relay.Value.kOn); // M+ = 12V, M- = 12V
Have you tried this? It looks like kOn with direction kBoth will throw an exception.
  #8   Spotlight this post!  
Unread 05-03-2011, 00:34
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Individual Control of Each Spike output ?

Quote:
Originally Posted by Joe Ross View Post
Have you tried this? It looks like kOn with direction kBoth will throw an exception.
Ugh you are right. What a pain.

You're probably best duplicate your own custom Relay class, and modify the following to make it work...

Lines 220 to 228:

Code:
            case Value.kOn_val:
                if (m_direction == Direction.kBoth) {
                    m_module.setRelayForward(m_channel, true);
                    m_module.setRelayReverse(m_channel, true);
                } else if (m_direction == Direction.kForward) {
                    m_module.setRelayForward(m_channel, true);
                } else if (m_direction == Direction.kReverse) {
                    m_module.setRelayReverse(m_channel, true);
                }
                break;
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Closed Thread


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


All times are GMT -5. The time now is 12:58.

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