Mini Drawing Bot - Live Android App - Trignomentry

by jegatheesan.soundarapandian in Circuits > Robots

17327 Views, 173 Favorites, 0 Comments

Mini Drawing Bot - Live Android App - Trignomentry

cover.jpg
20191122_012416.jpg
20191122_012811.jpg
Mini Drawing Bot - Android to Arduino Draw2

Thank GOD and all of you for make my project Baby-MIT-Cheetah-Robot won the first prize in the Contest Make it Move. I am very happy because lot of friends ask lot of question in conversation and in messages. One of the important question was how the robot move smoothly (with out body up and down) and asked about the array in the program initialization, how it is calculated. For the answer of that questions i plan to make a drawing bot with the legs i designed for the Baby-MIT-Cheetah-Robot. This is the test leg first i designed before print all the four legs. Also for this i try to draw in android and transfer the data to arduino to draw.

I like maths very much, i believe all in the world run with maths. There is nothing with out maths. Here i detailed the maths used to calculate the degrees of servo in detailed.

Materails Required

20180718_234504.jpg
20191113_234009.jpg
20180718_232458.jpg

Materials Required

1)Arduino Uno R3 - 1No

2) HC-05 Blue tooth module. - 1No

3) Micro Servo - 3 Nos

4) LM2596 DC to DC Voltage Regulator. - 1 No

5) 3.7V 18650 Battery - 2 Nos

6) 18650 Battery Holder

7) 3D printed Arm (obj file given the arm page)

8) Small aluminum pipe (got from old FM antenna).

9) Some scrap items.

10) Plastic sheet to make cover.

Trigonometry and Pythagoras Theorem

Image1.jpg
Image2.jpg
Image3.jpg
Image4.jpg
Image5.jpg
Image6.jpg
Image7.jpg

The Image is self explanatory if you want to read continue....

What we have is noted first

Image1

Drawing arms dimension both lower arm 3Cm and both upper arm 6 Cm. The distance between the two servo arm arm axis is 4.5cm. So consider you put it all in a graph and mark the first servo center as (0,0) so second servo center is at (4.5,0).

Image2

Now mark a point in the graph where the pen want to move, now i make it at (2.25,5).

Image3 - Distance Formula and Pythagorean Theorem

Now we want to find the length of two lines (0,0) to (2.25,5) and (4.5,0) to (2.25,5). Use the Distance Formula and Pythagorean Theorem. From the formula Length = sqrt((X2-X1)square +(Y2-Y1)Square) (please see the image to see the formula in correct format). The point is in the center of the y axis with the servo, So the boths sides have same dimension of triangle. So the result is 5.48 in both sides.

Image 4

Now you can able to divide the triangles. We got 3 triangles with all the 3 sides known.

Image 5 Trigonometry - the law of cosines

Use the Trigonometry - the law of cosines to calculate the angles we want. Please see the image for formula.

Image 6 Radiant to Degree

The result from the Trigonometry is in radiant so use the formula Degree = Radiant * (180/pi()), to convert radiant to degree.

Image 6

Sum up the degrees in the same side to find the rotation of the arms.

Check the Math Again

Image8.jpg

Now a test, move the point in the graph to different point and calculate the degrees of the arm. I create a excel and find the angle. See the above excel for calculation.

Circuit

Mini drawing Circuit.jpg

Its a very simple diagram with Three servos control using the digital pin 5,6 and 9, where 5 and 6 pins used to drive the arm and 6 used to up down the arm. The HC05 Tx connected to Arduino pin 0 (RX) and RX connected to Arduino pin 1 (TX). From 2 Nos 18650 battery 7.4V given to Arduino vin pin and input side of LM2596 DC to DC Voltage Regulator through switch. Output from LM2596 DC to DC Voltage Regulator is given to the servo supply pins. Thats all the circuit over.

Develop Circuit

20191113_233433.jpg
20191114_001518.jpg
20191114_002445.jpg
20191114_005324.jpg

As like every project for this project also i make a shield with female header pins for HC-05 bluetooth and Male header for servos.

Create Servo Stand

20191114_224959.jpg
20191114_225038.jpg
20191114_225147.jpg
20191114_230739.jpg
20191114_230818.jpg

I use MG90S 2 Nos for arms and SG90 for pen up and down. Cut a small novapan sheet to fix the servos as shown in the figure. As like the picture hot glue the both MG90S servos in straight vertical and the SG90 in the base.

Arm in Tinkercad

Leg.jpg

The same leg designed for MIT Cheetah Robot and Printed by the 3D print service provider A3DXYZ. Only one set is required for the drawing bot. If you only design for drawing then change the drawing to make the pen holder at the end of one arm

Downloads

Fix the Drawing Arm

20191019_021424.jpg
20191019_021452.jpg
20191019_021522.jpg
20191114_231513.jpg
20191114_231528.jpg
20191114_235029.jpg
20191019_021346.jpg

The 3D Printed arm is received as 6 pieces, 4 arm pieces and 3 screw like pieces to joint the arms. Join the arms and use the feviquick to paste the screw piece. Paste the horn in the arm and quick fix it using fevi quick. Now make a simple program and put the servo 1 to 150 degree and servo2 to 30 degree and fix the horn in the arm and screw it. For up down mechanism simply use a servo horn.

Hinge for Up Down Mechanism

20191115_233514.jpg
20191115_234501.jpg
20191115_234906.jpg
20191116_002326.jpg

For Making Hinge i use a old micro tip pencil from scrap and a round metal rod from the scrap. Cut both sides of the Micro tip pencil and take the tube hot glue it with the novapan sheet, already servo is pasted. Now insert the rod in to the tube and place a tiny piece of novapan sheet on both sides of the rod between the base and rod and hot glue it. now the Hinge is ready.

Fix All in One Board

20191120_213908.jpg
20191120_213921.jpg
20191120_213934.jpg
20191120_213944.jpg
20191120_214006.jpg
20191120_214038.jpg

Use hot glue gun to fix it all in the single novapan sheet. I change the 18650 battery holder with the new one with switch built with it (old one fitted in the fully 3D printed Baby MIT Cheetah currently in development).

Pen Holder

20191120_225958.jpg
20191120_230459.jpg
20191120_231012.jpg
20191120_231722.jpg
20191120_232623.jpg
20191120_234425.jpg
20191120_234750.jpg
20191120_234809.jpg
20191121_001008.jpg
20191121_000949.jpg

I search for lot of items and finally found a aluminium tube in the scarp from FM antenna. Cut a 43 cm length (15 + 13 + 15) of the pipe abd try the sketch fitted in it correctly. Cut slot in the 15 cm from both sides and open the both sides and make it flat. bend it to 90 degree and make the rectangle to circle. Use file to polish the edges and put it straight to the arm and Quick fix it with the holder with the arm using feviquick.

Make a Cover

20191121_002237.jpg
20191121_003522.jpg
20191121_012321.jpg
20191121_012503.jpg
20191121_012529.jpg
20191121_012600.jpg
20191121_012642.jpg

Make a cover using plastic sheet and paste all the joints of the plastic sheet so it look like a box. Make a slot in the side for switch ON and OFF. Now every thing is completed. Mechanical and Electronics works are finished. Now its time for Computer program in Android and Arduino.

Paper Holder

20191121_231246.jpg
20191121_234250.jpg
20191121_235130.jpg
20191121_235229.jpg
20191121_235327.jpg

Cut 3 pieces of plastic sheets and paste in the edges with the board as shown in the figure. Cut paper 11cm X 16 cm to use in this holder.

Arduino Code

Minidraw arduino.jpg

In this program i minimize the coding in android and insert all the maths calculation in the Arduino. So the android only send the X,Y,Pen up down from the mobile through bluetooth and once the arduino receive the point as detailed in the step 2 of this project arduino program calculated the actual degree for two servos. Servo only rotate up to 180 degree at 60 degree the servo arms are very close so i set 60 as 0. So from 60 to 240 degrees only taken in account and rotate. If the degree go less than 60 or greater than 240 or not able to calculate then the pen up. Once the servo move to that position it send back "N" to the android once the android received "N" it send the next point.

Android Program

Screenshot_20191122-012600_Samsung Experience Home.jpg
Screenshot_20191122-012606.jpg
Screenshot_20191122-012611.jpg
Screenshot_20191122-012617.jpg
Screenshot_20191122-010047.jpg
Screenshot_20191122-012548.jpg

As like other Projects I use MIT App inventor to develop the android app. On the screen start use bluetooth picker to pick up the HC-05. If the bluetooth is connected, the next screen shown. In that screen a Canvas area is used to draw the line drawing once you start draw the Mini drawing bot also start to draw with you. in the bottom of the screen two buttons and one label box present. Redraw button is used to draw again in the line drawing and clear button is used to clear the image in the canvas. In the label it show the text send to arduino.

Only draw in bottom half only drawn by the bot because of the length of the arm.

Download the app from the link and install in your android mobile. aia file for the program is also attached for the developers.

First Test

20191121_000933.jpg

This is the first test draw in the novapan sheet. The name Siva is tested first. Sorry i forgot to reord this video.

For Cheetah Leg

leg moving pattern.jpg

Lot of leg moving pattern available on the net. Or use ur own pattern. Draw it in the mobile and record it in arduino used that pattern for leg movement. Main thing keep it in mind is if the chettah walk at the height of 6 cm two cross legs in 6cm and move forward and othe two cross legs in the air of 5.5 cm ad all come to 6cm then only the cycle repeats.

Final Workings Video and Some Output

DSCN5324.JPG
20191122_012416.jpg
DSCN5322.JPG
20191122_005936.jpg
20191122_012536.jpg
Mini Drawing Bot - Android to Arduino Draw1

I enjoy a lot on making in this project. same words again, I lean some new things from this project, I feel you also learn some small thing on reading this project. Thank you all for reading it.

Lot more to enjoy...............Don't forgot to comment and encourage me friends.