Spring 2016 Velociraptor: Sensors

By: Ashlee Chang (E&C)

Updated: 04/05/16

Table of Contents

Fulfilling the Requirements

Level 2 requirements #9 and #10 are stated as follows:

9. For the Velociraptor to have the ability to travel up a 6.5-degree incline, a gyroscope/accelerometer shall be implemented to preserve the chassis balance and thus meeting the Project Level 1, requirement 6.

10. In order for the robot to detect obstacles at a range of 20 cm in its path, an ultrasonic sensor shall be implemented to the build of the Velociraptor and thus meeting the Project Level 1, requirement 7. 

Thus, the two sensors that will be implemented on the Velociraptor will be an ultrasonic sensor and a gyroscope/accelerometer. Below are the trade-off studies conducted, analyses on the best option, and the team’s final decision.

How the Sensors Work

Ultrasonic Range Finder

Ultrasonic sensors use a process called echolocation, which uses sound as a form of location. A high frequency sound wave is generated; the time it takes for the sound to bounce off an object and back to the sensor determines the distance away from the object it is.

Gyroscope/Accelerometer

A gyroscope/accelerometer is a device to measure acceleration forces. Using this information, one can determine the plane at which the robot is tilted at with respect to Earth. It has crystal structures contained within it that generates vibrational stress to acceleration, inducing a voltage level reading.

Trade-off Studies

Ultrasonic Range Finder

tradeoffultrasonic

Ultrasonic Sensors Comparison

The first option is the component used for last semester’s MicroBiped. The neck and head length of the velociraptor will be approximately 15-20 cm long, which is the minimum distance the ultrasonic sensor must be able to detect. All of the ultrasonic sensors compared have at least a 2 cm minimum range. The velociraptor must be able to respond to an object forward-facing it, most likely 5-10 distance away from the end of its head. All of the maximum ranges for the ultrasonic sensors are well over 400 cm, which makes any of the options fine. Most standard sensors have a dimension of 50 x 15 x 14 mm, weight 10 g, need a 5 V power supply, and generate ultrasonic waves at 40 kHz. The resolutions range from 0.3 to 1 cm, all which are exceptional as the Arduino coding can be set up to respond at any point. The angle at which the echoes can bounce back is documented in the last column of the table. The RB-See-90 has an angle measurement double than the other ultrasonic sensors, but is also 5x the price. As demonstrated below, as the velociraptor approaches the hindering obstacle, the obstacle takes up a wider view within the vision of the ultrasonic sensor. Thus, a measuring angle of 15* is sufficient. These ultrasonic sensors use a PWM interface; a 10 micro-s pulse will initiate the ranging, and a pulse duration is outputted based on if and how far an object is away. The calculation for distance is Distance = [(Duration of high level)*(Sonic 340 m/s)]/2.

pic3

Measuring Angle and Distance

  • List of Products:
[SainSmart HC-SR04]: http://www.sainsmart.com/ultrasonic-ranging-detector-mod-hc-sr04-distance-sensor.html

[Banggood HY-SRF05]: http://www.banggood.com/HY-SRF05-Ultrasonic-Distance-Sensor-Module-Measuring-Sensor-Module-p-91444.html?currency=USD&createTmp=1&utm_source=google&utm_medium=shopping&utm_content=saul&utm_campaign=Electronic-xie-us&gclid=CK7pwoHpissCFYVCaQodpXIBbw

[GearBest HC-SR04]: http://www.gearbest.com/development-boards/pp_58067.html?currency=USD&gclid=CIeQwMrsissCFYM8aQodFM4FOw

[SeeedStudio RB-See-90]: http://www.robotshop.com/en/seeedstudio-ultrasonic-range-finder.html?gclid=CJ7LmePtissCFYSDaQodBvQOsg#productsReviewBoxTitle

[MaxBotix MB1030]: http://www.maxbotix.com/Ultrasonic_Sensors/MB1030.htm

Gyroscope/Accelerometer

gyroacceltradeoff

Gyroscope/Accelerometers Comparison

With accelerometers, there is a trade-off between the measuring range and its sensitivity. A smaller range will provide a more accurate reading, but won’t be able to handle higher velocities, and vice versa. For stationary tilting. Range notation is written as +#g. For tilting, +1.5g is recommended, robots +2g is recommended, for sudden stops +5g is recommended, and for vehicles such as a spaceship +250g is recommended. So the choice in range for the velociraptor should at least +2g. The weight and dimensions of the accelerometers are all similar, and won’t be a factor in the final decision. Ideally, a PWM output type would be ideal to work with in the Arduino because of its simplicity. However, all accelerometers researched seemed to either have an analog or a serial interface; the serial interface uses SPI (serial peripheral interface) and I2C (inter-integrated circuit). The E&C division manager recommended not to use such interface as it is difficult to master dealing with such data. Analog Device’s ADXL335 supports an analog interface, which will provide data that will be easy to work with.

  • List of Products:
[Freescale Semiconductor MMA8451]: https://www.adafruit.com/products/2019?gclid=CISlz8P1issCFQmQaQodjKwLqQ

[Freescale Semiconductor MMA8452Q]: http://www.robotshop.com/en/triple-axis-accelerometer-breakout-board-mma8452q.html?gclid=CNfjjqWEi8sCFQmqaQodNSYPGQ

[Analog Devices ADXL345]: https://www.adafruit.com/products/1231

[Analog Devices ADXL335]: https://www.sparkfun.com/products/9269

[Kootek GY-521]: http://www.amazon.com/Kootek-MPU-6050-MPU6050-sensors-Accelerometer/dp/B008BOPN40

Conclusion

pic5

GearBest HC-SR04 and Analog Device ADXL335

The sensors the velociraptor team would like to go with are GearBest’s HC-SR04 ultrasonic sensor and Analog Device’s ADXL335 accelerometer. The former was chosen based on an economical decision, as all ultrasonic sensors met the requirements in distance detection, resolution, and angle sensitivity. The latter was chosen because it not only has a more than sufficient measurement range of +3g, but also outputs analog data, a much easier interface to work with over SPI and I2C.

Update: Due to unforeseeable circumstances, the velociraptor team had to make some changes regarding the sensor choices. In regards to the ultrasonic sensor HC-SR04, the sensor was no longer functional once the object in front was out of range capability. Most HC-SR04s cheaply manufactured in China overlooked this important flaw. Once a high frequency wave was sent out, the sensor would standby and wait until this wave bounced off the object and returned. With no object in front of the sensor, the HC-SR04 would continue waiting. A clap of the hands or even shaking the sensor would act as a return signal, and the Arduino serial monitor would stop returning the error value -1. This is why the velociraptor team decided on investing in a nicer, better quality rangefinder that met the velociraptor requirements. The E&C division manager had a quality ultrasonic sensor on-hand, which our team purchased. For the gyroscope/accelerometer, there was miscommunication on what sensor was to be used for sensing orientation. Initially the team was told to use an accelerometer, hence the ADXL335 choice. However a couple weeks ago, the team was informed that a gyroscope was to be used, as analog inputs are actually more difficult to handle. Testing the GY-521 gyroscope/accelerometer combination board, a sample code was uploaded provided online, which was hundreds of lines long, using serial output type. Upon uploading to the Arduino, the code took up over an outstanding 50% of flash memory. Because the current walking code and Bluetooth code are approximately 20% each already, the team saw using this serial output type orientation sensor as unfeasible. Therefore, the team is sticking with the ADXL335 choice. Both the MaxSonar ultrasonic sensor and ADXL335 accelerometer codes have been tested and work successfully with some degree of accuracy.

IMG_4506

MaxBotix LV-MaxSonar-Ez3 MB1030 and Kootek GY-521

Works Cited

[1] Ultrasonic transducer: https://en.wikipedia.org/wiki/Ultrasonic_transducer

[2] Accelerometer: https://en.wikipedia.org/wiki/Accelerometer

[3] A beginner’s guide to accelerometers: http://www.dimensionengineering.com/info/accelerometers

[4] Accelerometer, Gyro and IMU Buying Guide: https://www.sparkfun.com/pages/accel_gyro_guide