Lil dog bot
Hardware- 6 Devlogs
- 27 Total hours
Dogbot: A quadruped robot (aimed to be) able to walk and dance using a remote control.
Dogbot: A quadruped robot (aimed to be) able to walk and dance using a remote control.
Successfully transferred my inverse kinematics calculations from paper and Desmos to code (supposedly). All these days, and I hadn’t actually double checked my work or finished coding the IK. On one occasion, I had coded something of a framework, but later had it accidentally deleted when trying to connect the project to Github (because I’m an idiot :P). So today I focused on one of the robot’s legs––the bottom left––because the IK is different for each leg. By using Serial.print to compare the values in the code to the values in Desmos (based on an input x, y, z), I was able to fix the bugs in my equations, since the equations from Desmos slightly differed from the code. I also added a map function to convert the angles into PWM. It will be a while before I actually test this on the servos, because I need to find a way to recharge my batteries, but I’m excited to use this code! :)
Fixed the mess that was my board management (is that how you call it?) by finally adding screws and a stricter fit to the design. Previously I tried adding a spring-like hold on both sides of the…uh…electronics holders?…but they were too loose, easily slid, and simply fell off whenever I nudged the bot a little (left). For the 9v battery holder (with the nano and breadboard on top), I added screws to the sides (I had planned this when I started designing before the summer, couldn’t figure it out, and had useless screw holes at the sides for a while), whereas the buck converter and the pca9685 holder was given a tighter tolerance (given that there were no screw holes in the bot body designed by the past me). Now they no longer fall off when testing the legs, making my life a lot easier (right)! :D!!!
I finished the inverse kinematics for my robot dog! While I already calculated angles for the femur and tibia (upper/lower linkages of the leg) based on (x,y), I had yet to calculate the hip angle based on a given (z,y) yet. The hip angle allows for the dog to move its leg outwards and inwards from the body, like your shoulder enabling your arm to swing left and right. However, there was now the challenge of maintaining a right angle between linkages 1 and 2! Instead of using the law of cosines, I just used the standard soh/cah/toa for right triangles, and tested my calculations in Desmos (here: https://www.desmos.com/calculator/hifeumrqwd).
Finally figured out Platformio! Apparently I had to include upload_port = COM3 and upload_speed = 115200 in the Platformio.ini file, and then type the code I wanted to upload into main.cpp…oops (took a long time for me to figure that out…)! That was my fault. I made progress with the robot dog, though––I had to manually figure out which PWM signals signified 0-180 degrees for each servo. This process included unscrewing the servos, testing minimum and maximum PWM values, then screwing them back in. But I’m very happy with the result, and I can start implementing the inverse kinematics!
Today I tried using Platformio for the first time, but there were a lot of pit stops along the way. Couldn’t understand why the port wasn’t connecting, and the servo suddenly stopped working! Still trying to fix the issue with the port…but figured out that the motor thought now was a good time for a disconnected gear (ᵕ—ᴗ—)
On the bright side, made progress with Desmos and step trajectory interpolation through a parabola and some handy math equations (here’s the link! :D https://www.desmos.com/calculator/vxmkw9d4zw). Frustrating day but had fun trying new things! :)
Calculated inverse kinematics for my robot dog. I used Desmos to double-check my calculations, but it was hard to understand the trigonometry and how it worked. After an ungodly amount of time spent watching Khan Academy videos and studying other graphs, I finally simulated the robot dog’s limb movement in Desmos (Here’s the link if you’re interested :D -> https://www.desmos.com/calculator/ey6wzovfjc)! Days spent on a graphing calculator and 33 minutes coding XD