Ultrasonic sensor detect obstacle's size
Posted: 18 Jun 2012, 11:47
Hi All,
I try use the US sensor to detect the obstacle's size, like height or width, the theory is simple, there's an object in front of sensor with distance 'line distance', move the US sensor which dirven by a motor, the motor move looply by a tiny steps each time, like:
when the detected distance jumped a big step, it means the the ultrasonic just passed by the edge of the object, then record the degree that motor rotated, like:
so base on 'line distance', 'edge point distance', 'rotated degree', I can easily cacualted the object's size(use the tan(int degreee)).
But I got some problem when use the sensor, it didn't work as I imagined, instead send a single line ultrasonic signal, it actually send 'bunch' of singlal to an object, like a single point light source, it's a Radial, I guess the cross section is like a retangle or sth, and the area of this retangle depens on the distance from the sensor, so this make it nearly impossible to get a clear edge, because from my test, even the sensor passed by the edge of object for a long distance, the distance still displayed very near.
Do you have any idears?
I try use the US sensor to detect the obstacle's size, like height or width, the theory is simple, there's an object in front of sensor with distance 'line distance', move the US sensor which dirven by a motor, the motor move looply by a tiny steps each time, like:
Code: Select all
RotateMotor(OUT_B, 10, 5);
Code: Select all
rotationTotalDegree = MotorTachoCount(OUT_B);
But I got some problem when use the sensor, it didn't work as I imagined, instead send a single line ultrasonic signal, it actually send 'bunch' of singlal to an object, like a single point light source, it's a Radial, I guess the cross section is like a retangle or sth, and the area of this retangle depens on the distance from the sensor, so this make it nearly impossible to get a clear edge, because from my test, even the sensor passed by the edge of object for a long distance, the distance still displayed very near.
Do you have any idears?