Go to Post FIRST people are so cool. - 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 04-02-2012, 15:13
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Wiring the photosensors (Rockwell)

We've tried wiring the photosensors for threeish days now, and we can't get a feedback when their wired to the cRIO. Are there any wiring diagrams that anyone has confirmed to work?
  #2   Spotlight this post!  
Unread 04-02-2012, 15:20
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: Wiring the photosensors (Rockwell)

How have you wired the power supply to the sensors? The ones used last year required 10.5 volts to work. They worked best wired to the pneumatics module, to assure either 12 or 24 volts being supplied. You only have to wire the output to one of the digitial inputs on the DSC.

Does that help?
__________________
Jon Mittelman

Senior Judge Advisor New England & Israel 2014-2015
Infinite Loop Mentor 2011-2015
TechnoTicks Mentor 2000-2011
Championship Chairman's Award 2009 Team236 TechnoTicks
Judge 2010-2015 Championships
Senior Judge Advisor New England District Championship 2014-2015
Judge Advisor Tel Aviv Regional 2007-2015
Judge Advisor Pine Tree Regional 2013
Maine Regional Planning Committee
New England District Planning Committee
Lead Inspector Microsoft Tel Aviv Regional 2006-2008
Judge & Lead Inspector GM/Technion Tel Aviv Regional 2006
Judge UTC Hartford Regional 2006
  #3   Spotlight this post!  
Unread 04-02-2012, 19:47
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,113
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: Wiring the photosensors (Rockwell)

If they're typical of the kind of photosensors often used in FRC, the wiring is simple. Power and common to the sensor comes from a 20 Amp breaker on the Power Distribution Board; the same branch can supply many sensors or other custom circuits. Signal from the sensor goes to the Signal pin of any Digital Input on the Digital Sidecar. That's it.
  #4   Spotlight this post!  
Unread 04-02-2012, 23:31
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Wiring the photosensors (Rockwell)

Well, I think we tried that. that may mean that the problem lays in the programming.

Usining java, you get to them with the DigitalInput class, right?

can someone tell me if this looks right for making a command be executed whenever three cameras are set off?


DigitalInput camera1, camera2, camera3;
InternalButton button1;

public OI(){
camera1 = new DigitalInput(1);
camera2 = new DigitalInput(2);
camera3 = new DigitalInput(3);

boolean C1 = camera1.get();
boolean C2 = camera2.get();
boolean C3 = camera3.get();

if (C1 && C2 && C3){
button1.setPressed(true);
} else {
button1.setPressed(false);
}
button1.whenPressed(new ThreeCameras());
}
  #5   Spotlight this post!  
Unread 05-02-2012, 10:09
loafdog loafdog is offline
Registered User
AKA: Maciej
FRC #2876 (DevilBotz)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Burlington, MA
Posts: 39
loafdog is on a distinguished road
Re: Wiring the photosensors (Rockwell)

I don't think the code you have written will work the way you want. The photo sensors are only read once when OI class is created. Is that what you intended? Or did you want the sensors being read during the entire time the robot is operated? I'm going to assume the latter is what you want.

In your main robot class find teleopPeriodic function. In there put calls to read the photo sensors and if all 3 are true start your command. You can do something similar for autonomousPeriodic if you want your command to run in autonomous mode. The *Periodic funcs get called repeatedly while the robot is running. I didn't test this code. You might want to post further programming questions on the Java section of the forum.

Code:
public class YourRobotClass {
    DigitalInput camera1, camera2, camera3;
    public YourRobotClass() {
	camera1 = new DigitalInput(1);
	camera2 = new DigitalInput(2);
	camera3 = new DigitalInput(3);
    }
    public void teleopPeriodic() {
        Scheduler.getInstance().run();

	boolean C1 = camera1.get();
	boolean C2 = camera2.get();
	boolean C3 = camera3.get();
        if (C1 && C2 && C3) {
          Command c = new ThreeCameras();
          c.start();
	}
	SmartDashboard.putBoolean("c1", C1);
	SmartDashboard.putBoolean("c2", C2);
	SmartDashboard.putBoolean("c3", C3);
    }
}
Have you read this doc? I found a hint for what you wanted to do on pages 31-36. The examples are in C++ but same thing applies for Java.
http://firstforge.wpi.edu/sf/docman/..._documentation

Have you seen the youtube videos about using CommandBased templates?
http://www.youtube.com/user/BradAMiller/videos

In the example projects in Netbeans you can open GearsBot sample and see lots of examples of a what a CommandBased robot can do.

Have you also checked that you are getting signals when an object you want to detect is passed in front of the sensors? Not sure if you are using the same model as last year, but those had led lights that changed color to indicate if the sensor was detecting anything or not. And they had to be calibrated.

-Maciej
  #6   Spotlight this post!  
Unread 05-02-2012, 22:18
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Wiring the photosensors (Rockwell)

that may just fix it. I'll find out tommarow night.
  #7   Spotlight this post!  
Unread 06-02-2012, 17:31
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Wiring the photosensors (Rockwell)

Well, C1, C2, and C3 are being read repetitivly now, but the cameras aren't actually giving back any signal.

It is wired as follows:
Blue to (-) in PD
Brown to (+) in PD
White to a signal in PWM
PWM to Digital IO on the sidecar

It's not working. Should the signal have a ground or something?
  #8   Spotlight this post!  
Unread 06-02-2012, 20:08
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Wiring the photosensors (Rockwell)

What kind of a voltage output should we expect to read from the signal on a multimeter?
  #9   Spotlight this post!  
Unread 06-02-2012, 22:17
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,113
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: Wiring the photosensors (Rockwell)

The photosensor does not output a voltage. It uses its NPN transistor driver to either pull the output wire to ground or to leave it alone. You need to connect it to a pullup resistor in order to be able to measure anything with a voltmeter.

Fortunately, the DIO signal pins on the Digital Sidecar provide exactly the pullup resistor you need. If the photosensor output is connected to a DIO signal pin, you will read 5 volts when the output is inactive, and 0 volts when it is active. (The white wire will be active when an object is detected.)
  #10   Spotlight this post!  
Unread 07-02-2012, 16:12
loafdog loafdog is offline
Registered User
AKA: Maciej
FRC #2876 (DevilBotz)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2009
Location: Burlington, MA
Posts: 39
loafdog is on a distinguished road
Re: Wiring the photosensors (Rockwell)

Have you tried adjusting the set screws on the photo sensors? Or checked what colors the leds are showing to verify the sensor works and is detecting things? You are using the 42EF-D1NAK-A2 ClearSight RightSight correct? I looked up the part on rockwell's website and found installation instructions. Click on the 'library' link and search for something like '42EF'. It mentions calibrating the sensor and describes what the led colors mean. If the leds are working then you know you have the sensor calibrated right and should get output on the signal line.

I also remember getting a data sheet with the sensors last year tho I could not find it on Rockwell's site. Try searching the forums, I found lots of hits from last year, like this one for example:
http://www.chiefdelphi.com/forums/sh...=photo+sensors
  #11   Spotlight this post!  
Unread 09-02-2012, 11:18
Shaun Coon's Avatar
Shaun Coon Shaun Coon is offline
Registered User
FRC #2487
 
Join Date: Jan 2012
Location: New York
Posts: 45
Shaun Coon is a jewel in the roughShaun Coon is a jewel in the roughShaun Coon is a jewel in the roughShaun Coon is a jewel in the rough
Re: Wiring the photosensors (Rockwell)

ok so you put the blue that is negative - and brown is positive + into the power distrabution board with a 20 amp breaker, the you connect the white wire to the white wire on a pwm and hook it up to the sicard
in other words
Blue -> ( - )
Brown -> PWR
White or Black -> SIG
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 19:52.

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