Monday 7 May 2018

Our Pet Spik3r

Below is a story of our pet Spik3r, which we have captured in the form of a small video clip. Our Spik3r was moving on as usual and we were about to give it some food (the bug). However, our Spik3r sensed some danger at that point of time and shot the bug. It started running backwards and stopped after some time. Enjoy the visual. (The Java program is also shared along with the visual).

Based on the mechanical assembly of the Spik3r, the large motor D is used to drive the robot forward. Another large motor A, is used to implement the sting. While the medium motor is used to implement the claw to catch the food (the bugs). The IR sensor is mounted on the front part of the robot in order to sense the existence of any danger. 

The program to drive the robot Spik3r consists of a single class, Spik3r2. It has a main method, which initializes all the three motors and the IR sensor in Distance mode. When the ESCAPE button is un-pressed and the IR Sensor does not find any object (danger) in front of it in a range of 20 cm, the robot keeps moving forward with the large motor D (which rotates with a speed of 400 degrees per seconds) and it also keeps moving its claw to catch the bug. The claw movement is done by rotating the medium motor through 220 to -220 degrees. The IR Sensor distance samples are fetched continuously while moving forward.  

If the robot locates a danger (our hand which is placing the bug in front of the robot) in less than 20 cm distance, it starts running backwards with a speed of 990 degrees per seconds. While running backwards, it stings the dangerous object (in the case of Spiker, it shoots a ball towards the dangerous object). The sting is caused by setting the large motor A at a speed of 640 degrees per second and rotating it through 600 degrees. The IR Sensor keeps fetching the Distance samples and as soon as the dangerous object goes out of sight, the robot starts moving forward again (unfortunately this forward movement at a later stage has not gotten captured in the video).





No comments:

Post a Comment