PING Question: Problem with Short-Distance Measurements
HappyLemming
Posts: 2
Hi hi,
I've recently coded interface with the PING sensor in verilog on the Spartan 3E FPGA.
The sensor works wonderfully with longer-distance readings (say, beyond a foot). With short-distance targets (say, 5 inch away), the sensor would falsely display "1 inch." (My code displays readings with a 1 inch resolution).
I've noticed that flat targets perpendicular to the sight of the sensor would consistently produce this false reading. When I tilt the target at a slight angle, so that it's not exactly perpendicular, the sensor would occasionally give correct readings.
Any idea what the problem might be? Could it be that with flat, perpendicular targets at distances shorter than a foot, there isn't the proper angling for the transmitting "chirp" to reflect back to the "echo" reciever?
I've recently coded interface with the PING sensor in verilog on the Spartan 3E FPGA.
The sensor works wonderfully with longer-distance readings (say, beyond a foot). With short-distance targets (say, 5 inch away), the sensor would falsely display "1 inch." (My code displays readings with a 1 inch resolution).
I've noticed that flat targets perpendicular to the sight of the sensor would consistently produce this false reading. When I tilt the target at a slight angle, so that it's not exactly perpendicular, the sensor would occasionally give correct readings.
Any idea what the problem might be? Could it be that with flat, perpendicular targets at distances shorter than a foot, there isn't the proper angling for the transmitting "chirp" to reflect back to the "echo" reciever?
Comments
When I increased the "delay before next measurement" from the recommended "200us" to something much larger like "1600us" the problem went away.
I think the problem might be related to the timing of the bidirectional pin of my FPGA Spartan 3E development board. The FPGA board probably didn't have enough time to switch the pin between "output" and "input" fast enough to trigger the ping firing of the next round. My code interpreted the non-reply as a (spurious) reading of "1 inch."