AI Teaches Me How to Make a Drawing Robot

by tylon22 in Circuits > Arduino

1742 Views, 20 Favorites, 0 Comments

AI Teaches Me How to Make a Robot

000305.png
20240521_224938.jpg

AI can be used for a lot of things, so I thought: what if it could teach me how to build a robot?


Chat GPT chat log: https://chatgpt.com/share/c3f6713b-adac-41d9-98d9-1ad727faf6bf

Supplies

000306.png
20240521_205858.jpg

2 Continuous Rotation Servos

1 Servo

2 Battery Packs (Originally I was going to use a LIPO battery, but the voltage was too high, so I decided to use two double AA battery packs instead)

1 Marker/Pen

1 Arduino

1 Breadboard

1 GoBilda Servo Horn

Screws, Wires

3D printer

CAD software (Fusion 360 was what I used)

Design Components: Chassis

000307.png
000313.png
000314.png
000315.png
000316.png
000317.png
000318.png
000319.png
000320.png
000321.png

I mostly followed the steps given to me by Chat GPT, with the first step being to design and 3D print my components.

I began with designing the body of the robot in Fusion 360. I knew I had a lot of servos I could use, so I decided for my drive system to use servos. I designed the robot body around this, with two servos as drive, and two pegs in the front to keep the robot from tipping over.

I used the Project Geometry tool in Fusion 360 a lot to reference based off the geometry of the Servo, to make sure that everything fit properly.

After the basic design, I added fillets to most corners to smooth things out and make the robot look a little less blocky.

Design Components: Pen Holder

000308.png
000322.png
000323.png
000324.png
000325.png
000326.png
000327.png
000328.png

I designed my pen holder to be able to attach to a GoBilda Servo horn, which would then attach to a servo in the front.

The pen would attach by using zipties through the holes.

I went back to my chassis design and added a mounting location for my servo as well, and I cut a slot out for the front of the servo to move freely as well.

Export and 3D Print Parts

000329.png
000330.png
000331.png
000333.png
20240521_200445.jpg
20240521_200826.jpg

In Fusion 360 I exported all my files as STEP files, then imported them into Bambu Slicer software.

I 3D printed them using PLA on a Bambu A1 Mini 3D printer.

After removing the supports, I had my parts ready.

Assembly

20240521_210532.jpg
20240521_210815.jpg
20240521_211027.jpg
20240521_211206.jpg

I went ahead and connected the Continous Rotation Servos on the bottom of the robot, as they will act as the drive system.

I then connected the normal 180-degree servo to the front of the robot and mounted the pen holder and the pen to it.


Electronics and Wiring

000309.png
20240521_223604.jpg
20240521_213631.jpg
1.jpg

For the Electronics and Wiring, I connected my 3 Servos to the power and ground rails on the bread board. I hooked up one battery pack to that power and ground rail, while the other battery pack I connected the power to the VIN on the Arduino and the ground to the ground rail. I then connected the ground rail to the Arduino as well.

What this does is one battery pack will give the Arduino power, while the other battery pack will control the Servos. It is also important to have everything on the same Ground rail or else the servos would not work.

I then connected the signal wires of the servos to data pins on the Arduino, D3, D4, and D5 were the pins I used.

Programming

000310.png
000334.png
000335.png
000336.png
000311.png
000337.png
000339.png

I began with doing all the setup functions for the Servos and control systems.

I then created functions to control all the Servos.

The numbers in the delayMicroseconds give different signals to continuous rotation servos, you may have to play around with these numbers. The general idea is giving 2000 should make a servo go forward, 1500 is neutral, and 1000 is backwards. To make the robot go forward however, I would have to give one servo 2000 and another 1000, since one servo is mirrored.

The penUp and penDown function just make the servo go to that angle.

Afterwards I continued following the steps given to me by Chat GPT and calibrated the servos and drive systems.

To make my robot do something, in the Arduino loop, I made I called the function, and then below that called the delay() function for that many milliseconds. What this does it allows for me to program and make my robot move for that amount of time.

Downloads

Completed Robot

000312.png
000338.png
20240521 221435
20240521 222148
20240521 222211
20240521 222547

I completed the robot and tested it's writing ability.

It worked and was able to draw fun shapes!

I think something that was a lot of fun to do was write some code and then just run it and see what the robot would make. There was a sort of mystery in programming it and giving it timings, as I had a general idea of what the robot would draw, but then in the real world it would make something cooler.