Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   2011 "Light Sensor" (http://www.chiefdelphi.com/forums/showthread.php?t=88937)

jase728 24-01-2011 01:16

Re: 2011 "Light Sensor"
 
the way I am doing it is a variance of the software they give us

basically using the basic digital input keep going straight until the input returns a false then using a gyri scope and getting a value from it you can auto correct

MagiChau 24-01-2011 05:58

Re: 2011 "Light Sensor"
 
I am planning on using the light sensors as confirmation sensors possibly if I want the robot to go diagonal in autonomous. I do not know however, if the light sensor detects the red/blue & yellow pro gaff tape.

The sensors would confirm what "path" you are on alongside with an angle measurement and data from accelerometer/encoder, then use trigonometry to calculate the distance that the robot needs to be from the peg. Possibly use the camera then to once again confirm the distance and possibly the height of the arm.

This is more for fun though, at the least we are going to have a mode that goes straight, using accelerometer data and camera to confirm distance from scoring peg. I guess the line can be used to stay on path if robot isn't straight but I have confidence in my team to align the robot.

kws4000 03-02-2011 15:42

Re: 2011 "Light Sensor"
 
This really helps, being boolean, but which wiring diagram do I use?

"Dual NPN and PNP outputs" or "NPN Outputs"?

Yes, this is straight from the included instructions.

apalrd 03-02-2011 15:50

Re: 2011 "Light Sensor"
 
Quote:

Originally Posted by kws4000 (Post 1015003)
This really helps, being boolean, but which wiring diagram do I use?

"Dual NPN and PNP outputs" or "NPN Outputs"?

Yes, this is straight from the included instructions.

Sorta neither.

The diagrams provided include "load", a resistor to pull-up the signal lines so they are high when not connected. The Digital Sidecar already provides those, so you just need to connect the brown to +12(red) on the PD board, blue to the gnd(black) on the PD board, and white or black to a SIG pin on one of the DIO ports on the digital sidecar. You don't need white and black, pick one. White will tell you when you see light, black will tell you when you see dark, so if you have one, you know the other.

kws4000 03-02-2011 15:55

Re: 2011 "Light Sensor"
 
HALELUJAH!

PSHRobotics 04-02-2011 00:08

Re: 2011 "Light Sensor"
 
Since there seems to be some confusion about this, the Autonomous Independent vi from the "Robot Code with Game Framework" in LabView for 2011 actually does the line tracking using the Light Sensors. My team has created our own code using two sensors instead of three (like the code we are provided with) in case we want to use the third sensor for something else and because we see no use for the 3rd sensor and have had some trouble making sense of the code that was provided for us (because of the multiple values in the Steering Gain and Y Power controls). We finally got our code correctly functioning today. The most difficult part was stopping at the T because our sensors are not lined up perfectly (attached using duct tape at the moment), so we had to adapt the code to stop if the sensors became true within half a second of each other.

If anyone has any questions about programming for the sensors I'll help as much as possible.

jase728 04-02-2011 19:46

Re: 2011 "Light Sensor"
 
I decided to code our line tracking using a state machine. Just use a bunch of switch statements.

Shruikan27 05-02-2011 14:23

Re: 2011 "Light Sensor"
 
Quote:

Originally Posted by apalrd (Post 1015015)
Sorta neither.

The diagrams provided include "load", a resistor to pull-up the signal lines so they are high when not connected. The Digital Sidecar already provides those, so you just need to connect the brown to +12(red) on the PD board, blue to the gnd(black) on the PD board, and white or black to a SIG pin on one of the DIO ports on the digital sidecar. You don't need white and black, pick one. White will tell you when you see light, black will tell you when you see dark, so if you have one, you know the other.

Hello, this is my first year in FRC, and my mentor set me on the task of an issue we were having with the light sensor. I'm sorry if I sound like a complete newb but where exactly does the blue/black and the brown/red attach to on the PD Board? This forum has been very helpful to me and I thank you all for your input.


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

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