Go to Post Did you inform McMaster Carr that up to 3000 FRC teams would all be attempting to acquire a very specific spring ASAP all on the same weekend? - cgmv123 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 31-01-2011, 14:59
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Photoswitches flashes true but then stays false

Ok, so we were testing out the photoswitches.
The wiring is this:
Brown the positive
Blue to negative
Both on the power distributor with a 20 amp circut breaker
White to port 1 in the digital I/O of the digital sidecar
Basically what happens is that we hit enable, the value flashes true (we have the value printed to the DriverStationLCD) and then stays false.
Here is my code so far
Code:
DigitalInput tracker = new DigitalInput(1);
teleopPeriodic(){
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2011, 16:07
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Photoswitches flashes true but then stays false

After some further testing, it seems that the tracker gives some better feedback when we initialize a motor and set it to full force
Code:
DigitalInput tracker = new DigitalInput(1);
Victor motor = new Victor(1);
teleopPeriodic(){
motor.set(1);
DriverStationLCD.getInstance().println(Main6, 1, ""+tracker.get());
DriverStationLCD.getInstance().updateLCD();
}
However, it continously flashes true and false when it is detecting something
I've tried toying with the sensitivity, but to no avail
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2011, 23:20
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Photoswitches flashes true but then stays false

Ok, so I finally got a weird solution to the problem
Turns out that for every digital input we initialized (the trackers), we had to create a victor in the corresponding port. Meaning
Code:
DigitalInput tracker = new DigitalInput(1);
Victor motor= new Victor(1);
For some reason, initializing this victor makes the photoswitches works correctly
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2011, 23:58
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: Photoswitches flashes true but then stays false

Does your digital sidecar have good power? Are all three LEDs on the digital sidecar brightly lit? Do they stay lit if you remove the DB-37 cable?

If the digital sidecar power isn't connected, there is still current provided through the DB37 cable, which might be enough for intermittent operation. Add calls to a speed controller will cause more signals to go through the DB37 cable, and provide more power.

Last edited by Joe Ross : 02-02-2011 at 09:30.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2011, 14:50
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Photoswitches flashes true but then stays false

All three LEDs are on and shining brightly
When I remove the DB37 cable, the 5V goes off
Am I missing something?
I have two wires coming from the PD with a 20 amp circut breaker going into the dsc J22
and I got the db37 cable coming from the cRIO
__________________

Last edited by kinganu123 : 03-02-2011 at 14:55.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2011, 13:56
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: Photoswitches flashes true but then stays false

Quote:
Originally Posted by kinganu123 View Post
All three LEDs are on and shining brightly
When I remove the DB37 cable, the 5V goes off
Am I missing something?
I have two wires coming from the PD with a 20 amp circut breaker going into the dsc J22
and I got the db37 cable coming from the cRIO
The fact that the 5V LED goes off when you remove the DB37 cable indicates that there is a problem with the power wiring of your digital sidecar. It's sometimes possible to crimp the insulation of the wire in the wago connector, rather then the bare wire. Verify that you actually have 12 volts at the digital sidecar connector.
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


All times are GMT -5. The time now is 11:19.

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