Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Sensors (http://www.chiefdelphi.com/forums/forumdisplay.php?f=173)
-   -   Line Tracking Photoswitch Info and Demo Video (http://www.chiefdelphi.com/forums/showthread.php?t=89840)

riptide 22-01-2011 20:56

Line Tracking Photoswitch Info and Demo Video
 
1 Attachment(s)
Info gathered from other threads for one stop shopping.

Brown +
Blue -
White (sig) to digital side car
Black nothing

If the Sensor is Green: Sensor is powered but does not sense reflection. no output on blk or wht.

If sensor is Orange: ON sensor is recieving at least 2.5 times the signal strength needed to trigger an output and green will turn off. May have to adjust the sensitivity adjustment on top of the sensor to get an orange on if already mounted. Do this by placing over reflective surface and adjust until it comes on. Sensitivity is the screw on top. If orange is not on there will be no output on blk or wht.

If sensor is Yellow: the output has been energized meaning it sensed a reflective object. be careful most bright objects can be sensed regardless of color.

Typical sensor indication is the following
Green ON, Orange OFF, Yellow OFF over dull none reflective surface wht low and blk high
Green OFF, Orange ON and Yellow ON over bright reflective surface wht high and blk low

If you have a flashing LEDs, the sensor has gone in to short circuit protection mode becasue one of the outputs is shorted to ground or it is not wired up correctly. Make sure the black wire is not connected ianything. Make sure the white is connected to the signal pin on the digital side car pwm input and not the + or -. Best way to prevent the shorting out of the black wire is to clip the stripped wire and then wrap it with electrical tape. Inspect the sensor cable for any nicks. I will try and post a quick video by the end of today to show how it works and how to connect it.

Demo 1 01-22-2011
http://www.youtube.com/watch?v=t7pf-yWae0k

Demo 2 01-22-2011
http://www.youtube.com/watch?v=algLRT4Tawc


Hope this helps...

Belly 23-01-2011 12:32

Re: Line Tracking Photoswitch Info and Demo Video
 
Hey do you have or know where I can get a working Java code for the Photoswitches? I have 3 of them connected to the DIO. I dont mind switching my hardware configuration to be compatible with yours if it is not already.
Narcisse- 1340

riptide 23-01-2011 21:04

Re: Line Tracking Photoswitch Info and Demo Video
 
I'm sorry Belly, but I don't. If I come across something I'll keep you in mind.

pigpc1993 25-01-2011 17:42

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by Belly (Post 1006382)
Hey do you have or know where I can get a working Java code for the Photoswitches? I have 3 of them connected to the DIO. I dont mind switching my hardware configuration to be compatible with yours if it is not already.
Narcisse- 1340

My programming team is also having trouble finding example code. If you find anything could you let us know two?

Joe Ross 25-01-2011 18:54

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by Belly (Post 1006382)
Hey do you have or know where I can get a working Java code for the Photoswitches? I have 3 of them connected to the DIO. I dont mind switching my hardware configuration to be compatible with yours if it is not already.
Narcisse- 1340

Did you look at the LineTracker Sample Project in netbeans?

Ethan Spitz 27-01-2011 18:51

Re: Line Tracking Photoswitch Info and Demo Video
 
We have ours tracking the line as well with 2 or 3 sensors:

http://www.youtube.com/watch?feature...&v=PBG5g8geATw (3 sensors)

http://www.youtube.com/watch?v=06FPQ...er_profilepage (2 sensors)

Ethan

wazcodez 29-01-2011 18:24

Re: Line Tracking Photoswitch Info and Demo Video
 
we can't get code working in labview ? does any one have custome code rather than .. default which is too hard to understand .. we are rookie

Ethan Spitz 29-01-2011 18:27

Re: Line Tracking Photoswitch Info and Demo Video
 
I would start out by making a handwritten flow chart saying what you want it to do when each sensor is triggered. For example, when the left sensor is triggered, make it go right, and when the right sensor is triggered, go left. When neither are triggered, go straight.

Just use nested case statements and use the DIO ins to be the input for the case statements

Ethan

wazcodez 29-01-2011 20:39

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by Ethan Spitz (Post 1011291)
I would start out by making a handwritten flow chart saying what you want it to do when each sensor is triggered. For example, when the left sensor is triggered, make it go right, and when the right sensor is triggered, go left. When neither are triggered, go straight.

Just use nested case statements and use the DIO ins to be the input for the case statements

Ethan

Thanks for replying, should i control motor inside the nested loop or change the value for x or y inside the loop ? which will be sufficient enough and how do i know tht i have reached the "Y" part, i just started the programming ... ?

thanks for your help, will lwt you know if i have any problems ... thanks

Ethan Spitz 29-01-2011 20:41

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by wazcodez (Post 1011376)
Thanks for replying, should i control motor inside the nested loop or change the value for x or y inside the loop ? which will be sufficient enough and how do i know tht i have reached the "Y" part, i just started the programming ... ?

thanks for your help, will lwt you know if i have any problems ... thanks

I put the set output inside the loop because its less cluttered, but you could just put the value inside, that would work just as well.

You know it gets in there when the desired thing happens when you try it with the robot.

wazcodez 29-01-2011 21:08

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by Ethan Spitz (Post 1011378)
I put the set output inside the loop because its less cluttered, but you could just put the value inside, that would work just as well.

You know it gets in there when the desired thing happens when you try it with the robot.

i will follow your advise

tht's wht i did now ...



any suggestion and yea how do i make robot turn slowly !!!

thanks again

Ethan Spitz 29-01-2011 21:11

Re: Line Tracking Photoswitch Info and Demo Video
 
I seriously hope you're trying to be funny, becuase you have to put set motor output in there....

don't use the arcade drive module use the set motor output module

and to make it turn slowly, just use (to go right for example) right motor output at .1 and left motor output at .2 with them both going forward

Ethan

wazcodez 29-01-2011 21:38

Re: Line Tracking Photoswitch Info and Demo Video
 


Does this look proper ?

or beacuse of having arcade drive module, the value from (set motor output) would not matter, right ?

should i keep it like this ?

if tht's not the case then should i create new drive system (tank...) just for the autonomous and then switch it back to arcade ? OMG !!!

thanks man ! you have been greatly helpful

Ethan Spitz 29-01-2011 21:42

Re: Line Tracking Photoswitch Info and Demo Video
 
Ive never used the tank or arcade module so I wouldn't know :P

Should I assume you got it?

If so, congrats, and you're very welcome, feel free to message me or email me whenever you need help

Ethan

Ethan Spitz 29-01-2011 21:44

Re: Line Tracking Photoswitch Info and Demo Video
 
I do have one problem with your code however. You need to open everything up in your begin.vi or you are going to run into a lot of problems. Also make sure you close everything in your final.vi

Ethan

StevenB 30-01-2011 00:32

Re: Line Tracking Photoswitch Info and Demo Video
 
1 Attachment(s)
Just a couple additional notes, since I'm an electrical engineering student and happened to be wiring the sensor up today.
  • The sensor acts like a switch that closes when it sees a white object. It's using transistors inside rather than a mechanical switch, but as far as the wiring is concerned it acts just like a limit switch (except that it needs +12V power). Like a limit switch, it has a "normally open" and "normally closed" output; one output will be high when it sees a light object, the other will be high when it sees a dark object. Look at the sensor datasheet for all the gory details.
  • The digital sidecar has built-in pullup resistors, which means that unless you connect the GPIO pin to ground, it will have a value of 5V. This means you don't need any additional circuitry to hook up the photoswitches. See the Digital Sidecar datasheet for more information.
  • The attached schematic tries to show the whole picture. Note that you could just as easily connect the black wire to the GPIO pin, it's just a matter of whether you get a "1" for dark or a "1" for light. (My apologies if I mixed up LO and DO on the schematic. Let me know and I'll fix it.)
  • The part number is 42EF-D1MNAK-A(2). The 2 isn't given, but it's apparently part of the number based on Rockwell's part selection tool. If you haven't found it already, a CAD model (STEP) is available on Rockwell's site.
To those wondering how you program these things: it's a switch - a digital input - a 1 or a 0. Once you calibrate it, it will have one value when it's over the carpet and the other value when it's over the tape. All you have to do is read the sensor value to determine if you're on the tape or not.
If you have questions about how to follow a line, look at this white paper from NI, or ask an FLL student.

SHH 09-02-2011 21:03

Re: Line Tracking Photoswitch Info and Demo Video
 
We have hooked the photoswitch up to the power distribution board and to the signal pin on the DSC, but we only recieve "true" when we use the DigitalInput get() method, no matter what surface the photoswitch is directed at. Any help would be greatly appreciated.

kinganu123 09-02-2011 21:59

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by SHH (Post 1019515)
We have hooked the photoswitch up to the power distribution board and to the signal pin on the DSC, but we only recieve "true" when we use the DigitalInput get() method, no matter what surface the photoswitch is directed at. Any help would be greatly appreciated.

I found that initializing Victors (doesn't matter if they are really there or not) solved my problem. The DB37 cable apparently needs to send more power and this is only possible by creating more "sensors" in the DSC
But before you do that, do your lights change color? Green when it sees nothing and orange and yellow when it does?

Alan Anderson 09-02-2011 22:53

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by kinganu123 (Post 1019561)
I found that initializing Victors (doesn't matter if they are really there or not) solved my problem. The DB37 cable apparently needs to send more power...

Ack! You need to make sure that you are properly supplying battery power to the Digital Sidecar's small white Wago power connector. The power should come from a 20 Amp circuit on the Power Distribution board.

Nicandy 14-02-2011 14:09

Re: Line Tracking Photoswitch Info and Demo Video
 
What did you use to connect the white sensor wire to connect the photoswitch to the I/O on the digital sidecar? :confused:
Sorry for posting such a basic question on a month old thread, but any help would be greatly appreciated. :o

Alan Anderson 14-02-2011 15:20

Re: Line Tracking Photoswitch Info and Demo Video
 
Quote:

Originally Posted by Nicandy (Post 1022744)
What did you use to connect the white sensor wire to connect the photoswitch to the I/O on the digital sidecar? :confused:

Cut one of the three-wire PWM extension cables in half. One half will have the appropriate connector for the Digital Sidecar's I/O pins. Carefully tuck the cable's black and red wires out of the way, covering the ends with electrical tape so they don't contact anything. Splice the cable's white wire to the sensor's signal.

Or you can do what we typically do and make your own connector. Crimp the appropriate kind of female pin onto the sensor's signal wire and insert it into the appropriate kind of servo-style connector housing. We're running low on parts and should probably order more from a place like Hansen Hobbies.


All times are GMT -5. The time now is 21:53.

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