AI Teaches Me How to Make a Drawing Robot
by tylon22 in Circuits > Arduino
1662 Views, 18 Favorites, 0 Comments
AI Teaches Me How to Make a Robot
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
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
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
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
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
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
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
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
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.