Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   IR Beacon/reciever not working... still... (http://www.chiefdelphi.com/forums/showthread.php?t=24520)

Ferazel2001 29-01-2004 20:17

IR Beacon/reciever not working... still...
 
We built the IR unit, Then wired the reciever, then fixed both of them, and uploaded the program on Kevin.org but the setup is STILL not working.

Has anyone else had problems?
Can someone upload a picture of the setup, Top/bottom of a working reciever/transmitter and what code you used?

Thanks,
Devon

SeanCassidy 29-01-2004 20:46

Re: IR Beacon/reciever not working... still...
 
Make sure (for testing) you use tracking.zip instead of navigate.zip. I heard it can create problems. So try the tracking one.

DanL 29-01-2004 23:50

Re: IR Beacon/reciever not working... still...
 
Yes, start with tracking.zip

If your setup is fine, tracking.zip should make your servos go from left to right constantly until they catch the light. If they aren't moving after you load tracking.zip, then...

1. Check your wiring.
1a. Make sure the proper pins of the receiver are connected to the proper pins of the pwm wire (check the usfirst.org pdf)
1b. Check to make sure each of the receivers are plugged in to the correct Digi-input. If memory serves me right, IR_1 -> int01, IR_2 -> int02 IR_3 -> int04 IR_4 -> int05 (where IR_1 is left on left servo) - note the skipping of int03
1c. Check to make sure the servos are plugged in to the correct PWM-out (check the code)
1d. Do you have the backup battery charged and hooked up? The servos don't run without it.

2. Troubleshoot the receivers
2a. Turn the beacon off. Do the servos move then? If no, the problem is with your wiring. If yes, the problem lies with the setup of the receivers
2b. Check for reflections
2c. Bring your beacon down to 2 or 1 emitter LED
2d. Ambient light (see Kevin's faq)
2e. Receivers 'shotgunned' enough?

That should be enough to get you started. The purpose of the tracking code is to get your setup working - if the tracking code doesn't work, go back and refine your physical setup. When you get that to work, go to navigate.zip. I personally found that testing the nav code on blocks was a waste of time... you need to have the robot moving on the ground to have the code work.

Team981 30-01-2004 01:15

Re: IR Beacon/reciever not working... still...
 
FIRST made a mistake in the original detector diagram by reversing the 5 Volts and the Signal lines that was corrected in the afternoon of 1/29. Unfortunately for my team we blew up a detector before figuring to check Vishay's specs. Make sure that if you are looking at the detector from the front bulbed portion of it that it's wired from left to right as follows:

White/yellow | Black | Red

Also a simple code attached to the end of user_routines_fast.c in the portion that executes every loop on the EDU-bot RC can test whether your receiving or not. an example follows.

if (rc_dig_in01 != 1)
txdata.rc_pwm08 = 0;
else
txdata.rc_pwm08 = 127;

This causes a motor on PWM 8 to move when the detector finds an infrared signal. Rudimentary and crude it may be but it worked for our team. You can change this to suit your available PWM spaces and Digital inputs.

capenga 30-01-2004 05:41

Question...
 
How can i see the distance between the receiver and the transmitter??
I've read all the programs, but I didn't understand how can I do it. If someone knows, please help.

Thanks! :D

deltacoder1020 30-01-2004 08:38

Re: IR Beacon/reciever not working... still...
 
the sensors don't directly measure distance - if you want to find that, you'll have to use something called parallax - that is, using the two angles of the sensor servos, plus the known distance in between them, to calculate the missing sides of a triangle, and thus know the distance.

Ferazel2001 30-01-2004 09:22

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by Team981
FIRST made a mistake in the original detector diagram by reversing the 5 Volts and the Signal lines that was corrected in the afternoon of 1/29. Unfortunately for my team we blew up a detector before figuring to check Vishay's specs. Make sure that if you are looking at the detector from the front bulbed portion of it that it's wired from left to right as follows:

White/yellow | Black | Red

Also a simple code attached to the end of user_routines_fast.c in the portion that executes every loop on the EDU-bot RC can test whether your receiving or not. an example follows.

if (rc_dig_in01 != 1)
txdata.rc_pwm08 = 0;
else
txdata.rc_pwm08 = 127;

This causes a motor on PWM 8 to move when the detector finds an infrared signal. Rudimentary and crude it may be but it worked for our team. You can change this to suit your available PWM spaces and Digital inputs.

Er, someone probly said this somewhere else, but I still havent found it. What PWM port does the Beacon go in on the EDU RC?

Also, We the program for the competition RC set up so it printf's digitalIO's current value, (if it changes). Our value goes from 260± 40 to 400± 50. Do all of the digital inputs always do this?

deltacoder1020 30-01-2004 12:21

Re: IR Beacon/reciever not working... still...
 
i believe beacon type 1 is on pwm1, and beacon type 2 is on pwm 2, but I may be incorrect.

as for printf, make sure you're casting the value to (int) before you pass it to printf - otherwise you'll get a printed value that's 256 times the true value of the unsigned char variable.

Team981 30-01-2004 12:34

Re: IR Beacon/reciever not working... still...
 
1 Attachment(s)
If using the EDU rc the program contained in beacon.zip (attached) you should connect the beacon to PWM 1 or 2. Each provides a different frequency for homing onto.
Now regarding the issue with your printing values I'm not sure whats going on there as I'm new to C so somebody else will need to answer that one, Sorry.

Damian Manda 30-01-2004 23:34

Re: IR Beacon/reciever not working... still...
 
Yes, we have been having problems too.

We have set up our system with the proper code running on both the EDU and Full-Size RC, the beacons wired correctly and the detectors hooked to the correct pins. We know that the beacon is emitting infrared, since we can detect it with a learning remote. When the bacon is off, the remote says "No Infrared Detected." We need to figure out if the beacons are somehow emitting the wrong waveforms/frequencies, or if our detectors are just faulty (we have tried more than one). We have hooked the sensors to various inputs, and even wired it to an LED, to no avail. Is there any way to do this without an oscilloscope or other expensive instrument that we do not have? We have everyone that knows anything about the code and infrared stumped, even the engineers. Any hints on other things to test or try?

--Damian Manda

tml240 30-01-2004 23:45

Re: IR Beacon/reciever not working... still...
 
we have problems with Receiver only.....we tried to increase the voltage....increase power...we left the code tho... anyone actually tried the electrical side to this problem?

Ferazel2001 31-01-2004 12:22

Re: IR Beacon/reciever not working... still...
 
Oops, Did I say port? I ment what PINS do the PWM cables connect too, cause PWM's on the new EDU RC are no longer 3 pins, now they are four. how are we supposed to connect them? are they the 3 pins farthest away from the center?

Matthew_H 31-01-2004 13:08

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by Ferazel2001
Oops, Did I say port? I ment what PINS do the PWM cables connect too, cause PWM's on the new EDU RC are no longer 3 pins, now they are four. how are we supposed to connect them? are they the 3 pins farthest away from the center?

You will notice on the pwms there is pin that will tell you where to put the black side of the cable.

Ferazel2001 31-01-2004 14:07

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by Matthew_H
You will notice on the pwms there is pin that will tell you where to put the black side of the cable.

well, thats what we thought. thanks for confirming.

Ryan Cumings 31-01-2004 22:24

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by Damian Manda
Yes, we have been having problems too.

We have set up our system with the proper code running on both the EDU and Full-Size RC, the beacons wired correctly and the detectors hooked to the correct pins. We know that the beacon is emitting infrared, since we can detect it with a learning remote. When the bacon is off, the remote says "No Infrared Detected." We need to figure out if the beacons are somehow emitting the wrong waveforms/frequencies, or if our detectors are just faulty (we have tried more than one). We have hooked the sensors to various inputs, and even wired it to an LED, to no avail. Is there any way to do this without an oscilloscope or other expensive instrument that we do not have? We have everyone that knows anything about the code and infrared stumped, even the engineers. Any hints on other things to test or try?

--Damian Manda

We were fortunate to have not only one but two o-scopes lying around to see the waveforms for both the beacon and detectors. They both are exactly right. Type-1 Beacon causes the detector to go low for 1 ms, Type-2 for 2 ms.

We tryed with the tracking code and traced the problem all the way back to the digital inputs. Tonight I'm going to have a looksey to figure out what may cause the digital inputs to not work. (Note: if you hook up the detector this should keep the signal set to high as long as it doesn't see the beacon).

EDIT: Hmmm.... Maybe I'm wrong and that's why we are having trouble. Looking at the schematics and everything and maybe the input is 1 when the signal goes low. Test for tommorow I suppose.

[53] opticruzer 31-01-2004 23:16

Re: IR Beacon/reciever not working... still...
 
make sure that the beacon is hucked up right. the code is looking for either beacon type 0 or 1. look in the code and find out.

tml240 01-02-2004 12:07

Re: IR Beacon/reciever not working... still...
 
receiver's still not working.......since we only have one, we fixed the codes, but....still, none...

[53] opticruzer 01-02-2004 14:14

Re: IR Beacon/reciever not working... still...
 
are u sure that ur beacon is wired correctly. also check the wiring for the sensors.

Ryan Cumings 01-02-2004 15:38

Re: IR Beacon/reciever not working... still...
 
I just realized today, that the when the reciever goes low, it only goes low to 3.5 volts and when its high its ~4.9 volts. I think that it's not making the voltage dip low enough to have the controller register that something has changed. Can any other teams having problems (or have working recievers) verify this?

DanL 01-02-2004 16:28

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by tml240
receiver's still not working.......since we only have one, we fixed the codes, but....still, none...

Here's a few more things to try...

1. Make sure your beacon is on the right pwm output - we found that by default, the RC code looks for the beacon from edu-pwm-out 2, not 1
2. Again, make sure your left-left, left-right, right-left, and right-right receievers are on digital inputs 1, 2, 4, 5, respectivley - input 3 is not used.
3. Make sure your left and right servos are on the appropriate outputs (check the code you're using - there are several variations depending on if your running your tracking from the edu or the full rc)
4. **DEBUG YOUR BEACON/RECIEVER SETUP USING THE TRACKER.ZIP VERSION OF THE CODE**
4a. tracker.zip just makes the servos go back and forth until they find the beacon - there's no navigation or robot movement involved
4b. If you load the program on and your servos don't move...
4b1. Unplug the beacon. If the servos still don't move, you have a problem with your wiring. If the servos do move, they were successfully seeing the beacon or a reflection of the beacon. If the latter happened when you think it shouldn't have happened, refer to the various threads about the shotgun setup approach, ambient lighting, and Kevin's faq (http://www.kevin.org/frc)
4c. If your servos do move (even though you have your beacon in front of them)...
4c1. Check to make sure the beacon they're looking for is the beacon you're transmitting - if your beacon is on edu-pwm-1, move it to edu-pwm-2
4c2. Make sure all of the receivers are plugged in (sometimes the connectors fall out due to the servo's motion) and plugged in to the correct inputs (again, its 1, 2, 4, 5)
4c3. Make sure your beacon is working - I found this is best done by inserting a visible-wavelength LED with the appropriate resistor in parallel to the IR leds - when you move the beacon quickly from side to side, you should observe a strobe-light effect from this LED - this strobe effect means that power to the IR leds is being cycled according to the waveform the edu is generating
4c4. If those fail, you've got a wiring fault - check to make sure the correct PWM wires go to the correct pins on the receivers and the beacon. One way to debug this would be write a simple program that just printf's the value of the digital inputs and make the beacon output constant light instead of the pulsed waveform.

Again, the behavior of tracker.zip is it just makes each servo move back and forth until both of the servo's receivers find the beacon (or a reflection of it). For example, if you're holding the beacon right in front of the two servos and one servo is moving while the other is stopped, first unplug the beacon. If the stopped one starts moving, then you know there's nothing wrong with it and the problem must lie in the connections of the other one.

Also, I've said "unplug the beacon" several times because simply hiding it with your hands does not always work. Depending on the conditions of the room (ambient light, reflectivity of materials, etc.) and the quality of your 'shotgunning,' you could have conditions so bad that your receivers could be on one side of a box while the beacon is on the other and the receivers will still pick up a reflection of the beacon (trust me, it's happened to me). The best way to make sure your hiding the beacon is to unplug it.

Hope this helps everyone.

Kevin Watson 01-02-2004 17:33

Re: IR Beacon/reciever not working... still...
 
Quote:

Originally Posted by SuperDanman
1. Make sure your beacon is on the right pwm output - we found that by default, the RC code looks for the beacon from edu-pwm-out 2, not 1

If you don't put a switch on digital input 7 to select the type of beacon you want to track, it defaults to beacon type 1, which is present on PWM output 2 on the EDU-RC. Thanks for pointing this out. I'll add this to the FAQ.


Quote:

Originally Posted by SuperDanman
2. Again, make sure your left-left, left-right, right-left, and right-right receievers are on digital inputs 1, 2, 4, 5, respectivley - input 3 is not used.

This only applies to the code in navigate.zip. The version of receiver.c in tracker.zip uses 3, 4, 5, 6. The reason for this is in the FAQ.


Quote:

Originally Posted by SuperDanman
3. Make sure your left and right servos are on the appropriate outputs (check the code you're using - there are several variations depending on if your running your tracking from the edu or the full rc)

Actually, we've always used PWM1 and PWM2.


Quote:

Originally Posted by SuperDanman
4. **DEBUG YOUR BEACON/RECIEVER SETUP USING THE TRACKER.ZIP VERSION OF THE CODE**
4a. tracker.zip just makes the servos go back and forth until they find the beacon - there's no navigation or robot movement involved
4b. If you load the program on and your servos don't move...
4b1. Unplug the beacon. If the servos still don't move, you have a problem with your wiring. If the servos do move, they were successfully seeing the beacon or a reflection of the beacon. If the latter happened when you think it shouldn't have happened, refer to the various threads about the shotgun setup approach, ambient lighting, and Kevin's faq (http://www.kevin.org/frc)
4c. If your servos do move (even though you have your beacon in front of them)...
4c1. Check to make sure the beacon they're looking for is the beacon you're transmitting - if your beacon is on edu-pwm-1, move it to edu-pwm-2
4c2. Make sure all of the receivers are plugged in (sometimes the connectors fall out due to the servo's motion) and plugged in to the correct inputs (again, its 1, 2, 4, 5)

Also make sure you have a 7.2 volt battery plugged into the battery connector. The servos won't work without it.

-Kevin

DanL 01-02-2004 18:11

Re: IR Beacon/reciever not working... still...
 
1 Attachment(s)
Quote:

Originally Posted by Kevin Watson
Actually, we've always used PWM1 and PWM2

er, I was thinking about the version which ran both the tracking and the beacon off of one edu that Marc McLeod put together a few threads ago... that one had the servos off of PWM7 and 8


Anyways, since there seem to be many people having problems with their IR beacons, I decided to make a flowchart to help them debug common problems that I expierienced while getting my team's setup to work. This flowchart is a lot clearer and more organized than my last two posts, so I hope this helps everyone out. If anyone sees any mistakes/things that have been left out, let me know.

[EDIT]
From the origional version I posted, I changed a few things, fixed a few careless typos, and added some wiring maps to a second page. Check it out.

[53] opticruzer 02-02-2004 16:54

Re: IR Beacon/reciever not working... still...
 
well that voltage drop does seem correct. that is pretty much what we get.

Ryan Cumings 04-02-2004 23:30

Re: IR Beacon/reciever not working... still...
 
We got our hands on some detectors. This time the voltage droped down to 30 mV instead of 3.5 V. The controller registered an interupt and we rejoiced.


All times are GMT -5. The time now is 13:25.

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