The Propeller has plenty of speed. The Achilles heel will be the rate of which the PING sensor responds, and it will vary depending on how close or far away the object is. I just tested mine with the Propeller DEMO code and scoped the signal pin at about 16 samples per second, so there should be plenty of overhead to count boxes within your required time frame. It might help if there is a default backing for when a box is not present.
Backing
|
|
X
X
X ..... >|
X 'BOX' |PING sensor
X ''''' >|
X
X
You can't really prevent electrical noise, but you can shield from it. Standard shielding practices and clean power supply techniques (<-standard industrial requirements) should be fine as far as keeping electrical noise down to a minimum.
A factory environment with conveyors running is a very noisy place at ultrasonic frequencies. That noise can interfere with ultrasonic sensors, giving false readings. I say this from experience, having failed with ultrasonics to measure and count apples using the technology.
A factory environment with conveyors running is a very noisy place at ultrasonic frequencies. That noise can interfere with ultrasonic sensors, giving false readings. I say this from experience, having failed with ultrasonics to measure and count apples using the technology.
-Phil
Phil beat me to it. Much better to use an IR sensor, and one that uses a 40KHz carrier rather than a constant IR source is virtually fool proof.
But I had some problems with it. Sometimes the sensor start sensing even without boxes on the conveyor belt.
For this reason I thought about the PING sensor alternative but Phil wrotte : "...conveyors running is a very noisy place at ultrasonic frequencies..."
For this reason I will try to use infrared egain , but do you know how to protect it from the industrial noise too.
Do you have some information about it ?
The iR sensor that you bought certainly looks good, but there is nothing to verify that it used a carrier frequency and was set up to only receive the reflections of that frequency.
Even with IR, the world is a noisy place... so having a device that transmits and receives one frequency eliminates the majority if not all the false positives. Without a modulated IR, heat from lights can make a lot of problems.
Phil seems to have chosen a very expensive industrial option. There are other IR sensors that are quite inexpensive that work with a modulated IR.
Can you clarify what kind of budget you desire for this project? It would narrow down suggestions.
What Loopy said about carrier frequency (i.e. modulation). There's nothing in the eBay listing to suggest that the sensor is modulated, and that makes all the difference.
The most reliable system I have assembled consists of an IR emitter in the center of a 6 inches square piece of black painted aluminum and a 40KHz IR receiver module in a black painted tube. The emitter and receiver and receiver were mounted on opposite sides of the conveyor.
I have to agree that a through-beam setup is the most reliable, especially as compared to a reflective setup. And kwinn's extra preparations are certainly worth the effort under adverse circumstances.
If you are using a propeller for this you could probably do it with a simple led and phototransistor. Have the propeller pulse the led on and off at a fixed rate, and read the output from the phototransistor to determine if it is blocked by a box. A box is detected by receiving no pulses for a period of time.
After reading your posts It seems carrier frequency or modulation is important.
I have and old sensor a friend gave to me some years ago , I found it at the web yestarday , but how do you know
if this BM200-DDT has carrier frequency or modulation ?
I have just one BM200-DDT and I am testing it at home now , it works fine, but home is not a noisy place.
Using a carrier frequency makes the system less susceptible to ambient IR and electrical noise, and industrial/manufacturing sites tend to be very noisy. A well designed power supply also goes a long way towards reducing electrical noise.
BTW, using a reflective sensor may be the wrong choice for this application. Typically they only have a range of a few inches, and it may be that cardboard IR reflectivity is not sufficient for even that distance.
But, again, use a thru-beam sensor, not a reflective one. With a reflective sensor you risk two kinds of error: 1) missing a box entirely, and 2) counting the same box twice.
For optimum reliability, you can use two thru-beam sensors spaced half a box width apart. The outputs will be in quadrature with each other, so if a box backs up slightly then resumes forward motion, it won't get counted twice. Also, if someone waves their arm through the beams, it won't get counted as a box.
It seems I have to send a connetion to the +3.3volts of the voltaje regulator of the Propeller
, and the +12 volts power suply and R Must be 2.2K resistor
Is this correct ?
Thanks again. I will test.
PS: If I have problems I will try thru-beam sensor.
PS2: I thought you will not post because it is late , I was waiting your post , thanks.
Yes, although the exact value is not important. Anything between, say, 1K and 2.7K will work just fine.
The open-collector output of the sensor only pulls down (to 0V). This gives you the luxury of selecting the high voltage by choosing which level to tie the pull-up to. By tying it to the Prop's Vdd level, you automatically get compatibiloity with the Prop's inputs.
BTW, my very first industrial application was counting boxes in an apple-packing plant. It was not easy! Based upon that experience, I can only further advise this: keep the leads between the sensor and Propeller short!
Both of Phil's suggestions are excellent, particularly the one to use two thru-beam sensors spaced half a box width apart. If mounting the sensor and IR source on opposite sides of the conveyor is a problem there are two alternate mounting methods. You can use an "L" shaped bracket to mount the sensor above and behind the conveyor, and place the IR emitter below and between the rollers. The second method would use a "C" shaped bracket to mount the sensor above the center of the conveyor, and the IR emitter between the rollers below it. Having the sensor pointing at the floor reduces the pickup of stray IR.
But:
I have to send the data to a PC. The problem I have is about the distance between the Propeller
and the PC it is about 100 feet. I add the prop plug to the Propeller and I am converting the serial to the RJ45 I tested at home and it works fine
but It has been impossible in the real work.
Perhaps the noise , I don't know.
I will continue working and I will tell you if I have succes , thanks.
For that much distance between the Prop and the PC -- especially in a noisy industrial environment -- I would definitely use RS422 comms with your twisted-pair cable.
The individual wire pairs are already twisted around each other inside the insulating jacket of the cable. See the article here: Twisted pair-Wikipedia
but do you know if the individual wire must be crossed like the pictures ?
You can see at picture 1 of 7 , that the first position of connector 1 is joined with the third position of the connector 2.
Then , picture 2 = 2 joined with 6
Then , picture 3 = 3 joined with 1
Then , picture 4 = 4 joined with 4
Then , picture 5= 5 joined with 5
Then , picture 6 = 8 joined with 8
....
...
Generally the solid colored wire is twisted with the striped wire of the same color. These are a twisted pair inside the cable. The position on the connectors get switched around on crossover cables which is not the same as a twisted pair, though crossover cables have twisted pairs inside. I doubt you'll want to use a crossover cable in this application (I think crossover cables are used with ethernet equipment). A normal cat5 line should have four sets of twisted pairs to choose from.
RS422 uses differential signals. By twisting the wires with the signals together, you insure any noise received by one wire is also received by the other. Since the noise will be on both wires of the differential pair, it can be cancelled out. (I think I got most of that right. I'm mostly just spouting back what I've read on the forum.)
.............................................
RS422 uses differential signals. By twisting the wires with the signals together, you insure any noise received by one wire is also received by the other. Since the noise will be on both wires of the differential pair, it can be cancelled out. (I think I got most of that right. I'm mostly just spouting back what I've read on the forum.)
Right on Duane.
Markuster, both signals (+ and - , also shown as A - B and Y - Z need to use the two wires in a single pair as shown in the attached diagram. The problem with pre-made ethernet cables is that the pinouts of the connectors are not straight forward. That is why a lot of industrial and building automation equipment uses screw terminal strips. If you want to use off the shelf ethernet cables you need to take the wiring of the crossover cable into account when you connect the RS422 transmitters and receivers to the female RJ45 connectors. The attached diagram shows the typical wiring.
PS Using off the shelf cables is a good idea and well worth the minor inconvenience of dealing with the crossover wiring.
Comments
Reference:
http://www.parallax.com/downloads/ping-ultrasonic-distance-sensor-propeller-code
It seems 16 per second is more than enough.
The enviroment is industrial , there are some elecric motors runing near ( 4 feet) . And do you know how to prevent
electronic noise ?.
In other words , the Ping with the Propeller could work in industrial enviroment or just hobby ?
Thanks again.
A factory environment with conveyors running is a very noisy place at ultrasonic frequencies. That noise can interfere with ultrasonic sensors, giving false readings. I say this from experience, having failed with ultrasonics to measure and count apples using the technology.
-Phil
Phil beat me to it. Much better to use an IR sensor, and one that uses a 40KHz carrier rather than a constant IR source is virtually fool proof.
I started with an infrared sensor :
http://www.ebay.com/itm/Adjustable-IR-Infrared-Sensor-Switch-3-80cm-w-Fixed-Rings-/390670330880?pt=AU_B_I_Electrical_Test_Equipment&hash=item5af5c42c00
But I had some problems with it. Sometimes the sensor start sensing even without boxes on the conveyor belt.
For this reason I thought about the PING sensor alternative but Phil wrotte : "...conveyors running is a very noisy place at ultrasonic frequencies..."
For this reason I will try to use infrared egain , but do you know how to protect it from the industrial noise too.
Do you have some information about it ?
Mark.
Even with IR, the world is a noisy place... so having a device that transmits and receives one frequency eliminates the majority if not all the false positives. Without a modulated IR, heat from lights can make a lot of problems.
Phil seems to have chosen a very expensive industrial option. There are other IR sensors that are quite inexpensive that work with a modulated IR.
Can you clarify what kind of budget you desire for this project? It would narrow down suggestions.
-Phil
-Phil
After reading your posts It seems carrier frequency or modulation is important.
I have and old sensor a friend gave to me some years ago , I found it at the web yestarday , but how do you know
if this BM200-DDT has carrier frequency or modulation ?
I have just one BM200-DDT and I am testing it at home now , it works fine, but home is not a noisy place.
http://products.autonicsonline.com/item/photoelectric-sensors/light-common-type-photoelectric-sensors-bm-series-/bm200-ddt?
Mark
BTW, using a reflective sensor may be the wrong choice for this application. Typically they only have a range of a few inches, and it may be that cardboard IR reflectivity is not sufficient for even that distance.
I need just 10 inches (or less) range.
Do you know if BM200-DDT could work fine with the Parallax Propeller microcontroller ?
here is the link:
http://products.autonicsonline.com/i...es-/bm200-ddt?
Thanks.
-Phil
Here is the link again:
http://products.autonicsonline.com/item/photoelectric-sensors/light-common-type-photoelectric-sensors-bm-series-/bm200-ddt?
As to interfacing to the Prop, it should be easy: the ouput is open-collector, so just pull it up to 3.3V with a 2.2K resistor.
-Phil
But, how I can "pull it up to 3.3V with a 2.2K resistor"
Do you have some information about this ?
Is it like the attached picture , with R=2.2K ?
Thanks,
But, again, use a thru-beam sensor, not a reflective one. With a reflective sensor you risk two kinds of error: 1) missing a box entirely, and 2) counting the same box twice.
For optimum reliability, you can use two thru-beam sensors spaced half a box width apart. The outputs will be in quadrature with each other, so if a box backs up slightly then resumes forward motion, it won't get counted twice. Also, if someone waves their arm through the beams, it won't get counted as a box.
-Phil
Is the resistor (at your last attachemt ) 2.2 K ?
It seems I have to send a connetion to the +3.3volts of the voltaje regulator of the Propeller
, and the +12 volts power suply and R Must be 2.2K resistor
Is this correct ?
Thanks again. I will test.
PS: If I have problems I will try thru-beam sensor.
PS2: I thought you will not post because it is late , I was waiting your post , thanks.
The open-collector output of the sensor only pulls down (to 0V). This gives you the luxury of selecting the high voltage by choosing which level to tie the pull-up to. By tying it to the Prop's Vdd level, you automatically get compatibiloity with the Prop's inputs.
BTW, my very first industrial application was counting boxes in an apple-packing plant. It was not easy! Based upon that experience, I can only further advise this: keep the leads between the sensor and Propeller short!
-Phil
I tested the sensor and it works fine.
The Propeller is near the sensor ( 3 feet) .
But:
I have to send the data to a PC. The problem I have is about the distance between the Propeller
and the PC it is about 100 feet. I add the prop plug to the Propeller and I am converting the serial to the RJ45 I tested at home and it works fine
but It has been impossible in the real work.
Perhaps the noise , I don't know.
I will continue working and I will tell you if I have succes , thanks.
-Phil
I will do the job with RS422.
But I don't understand about "RS422 comms with your twisted-pair".
Is the standard cable used at offices ( 15 feet aprox. ) to join to the Net called twisted-pair, or twisted-pair cables are
used for RS422.
In other words:
Is it important a twisted-pair cable or a non twisted-pair cable. Must be twisted to use with RS422 ?
And how I can twist the cable , I have to twist at the end of the cable ? ( Do you have an schematics to understand it ? )
Sorry , I am a little confused.
thanks.
but do you know if the individual wire must be crossed like the pictures ?
You can see at picture 1 of 7 , that the first position of connector 1 is joined with the third position of the connector 2.
Then , picture 2 = 2 joined with 6
Then , picture 3 = 3 joined with 1
Then , picture 4 = 4 joined with 4
Then , picture 5= 5 joined with 5
Then , picture 6 = 8 joined with 8
....
...
Is this ok ?
Thanks.
RS422 uses differential signals. By twisting the wires with the signals together, you insure any noise received by one wire is also received by the other. Since the noise will be on both wires of the differential pair, it can be cancelled out. (I think I got most of that right. I'm mostly just spouting back what I've read on the forum.)
It is alittle difficult to understand to me.
So, I have to use a twisted cable and I have to crossover cables near the connectors like the pictures ?
Do you have something to read or a a link to an schematic picture ?
Thanks
Right on Duane.
Markuster, both signals (+ and - , also shown as A - B and Y - Z need to use the two wires in a single pair as shown in the attached diagram. The problem with pre-made ethernet cables is that the pinouts of the connectors are not straight forward. That is why a lot of industrial and building automation equipment uses screw terminal strips. If you want to use off the shelf ethernet cables you need to take the wiring of the crossover cable into account when you connect the RS422 transmitters and receivers to the female RJ45 connectors. The attached diagram shows the typical wiring.
PS Using off the shelf cables is a good idea and well worth the minor inconvenience of dealing with the crossover wiring.