oracid Posted December 21, 2023 Posted December 21, 2023 (edited) You can refer to my last quadruped, here, 8DOF-Q6 - Big Quadruped Robot - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums The code is here, 8DOF-Q6-Quadruped-robot/8DOF_Q6_Bis_RC_ref.ino at main · oracid/8DOF-Q6-Quadruped-robot · GitHub In this code you can see the IK() function. Yes, g=0 and c is the side of the diamond. So the code is more simple. Here the calculating part of this function : void IK(int Px, int Py, int LS, int RS, int Ay, int speed){ // Inverse Kinematics function .................................................. float Ax=0, c=168; // position of the main paw axis and length of femur and tibia float d=Ay-Py, e=Ax-Px; // d and e, sides of rectangle triangle float h=sqrt((d*d)+(e*e)); // h, hypotenuse of rectangle triangle float B=asin(d/h); if(e<0)B=(PI-B); // B is the top angle of the rectangle triangle float A=acos(h/(2*c)); // A is the Diamond half top angle (cosin law) int S1=round(degrees(B-A))+Err[LS]; // S1 is the left servo angle in degrees +Err int S2=round(degrees(B+A))+Err[RS]; // S2 is the right servo angle in degrees +Err . Yes, I am in Holiday. Edited December 21, 2023 by oracid Quote
glowytheglowbug Posted December 25, 2023 Author Posted December 25, 2023 (edited) On 12/22/2023 at 6:51 AM, oracid said: You can refer to my last quadruped, here, 8DOF-Q6 - Big Quadruped Robot - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums The code is here, 8DOF-Q6-Quadruped-robot/8DOF_Q6_Bis_RC_ref.ino at main · oracid/8DOF-Q6-Quadruped-robot · GitHub In this code you can see the IK() function. Yes, g=0 and c is the side of the diamond. So the code is more simple. Here the calculating part of this function : void IK(int Px, int Py, int LS, int RS, int Ay, int speed){ // Inverse Kinematics function .................................................. float Ax=0, c=168; // position of the main paw axis and length of femur and tibia float d=Ay-Py, e=Ax-Px; // d and e, sides of rectangle triangle float h=sqrt((d*d)+(e*e)); // h, hypotenuse of rectangle triangle float B=asin(d/h); if(e<0)B=(PI-B); // B is the top angle of the rectangle triangle float A=acos(h/(2*c)); // A is the Diamond half top angle (cosin law) int S1=round(degrees(B-A))+Err[LS]; // S1 is the left servo angle in degrees +Err int S2=round(degrees(B+A))+Err[RS]; // S2 is the right servo angle in degrees +Err . Yes, I am in Holiday. theres a bit of a problem my servos rotate clockwise instead of anticlockwise and I'm not sure how to use the inverse kinematics now ah got it I just need to do 180-S1 or S2 but I need to use 360 degrees Edited January 8, 2024 by glowytheglowbug solved? Quote
oracid Posted January 10, 2024 Posted January 10, 2024 Hello, I am back to civilisation. Happy new year. You must refer to this topic. 12DOF-Q-3 Quadruped whith GeekServos - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums As you can see, the axes of the servos are on the bottom. The 0° is on the left, The 90° is on the bottom. The 180° is on the right. In my quadruped, the servos are always used as 180°. My code is in description of the video. Quote
glowytheglowbug Posted January 15, 2024 Author Posted January 15, 2024 (edited) On 1/10/2024 at 5:52 PM, oracid said: Hello, I am back to civilisation. Happy new year. You must refer to this topic. 12DOF-Q-3 Quadruped whith GeekServos - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums As you can see, the axes of the servos are on the bottom. The 0° is on the left, The 90° is on the bottom. The 180° is on the right. In my quadruped, the servos are always used as 180°. My code is in description of the video. is there a way to use full 360 degrees of motion? so it can have more linear travel and more range of motion, been looking at some papers and websites but they are pretty overcomplicated, closest I found was stanford doggohttps://github.com/Nate711/StanfordDoggoProject#leg-trajectories Edited January 15, 2024 by glowytheglowbug (Happy new year! :D ) good holiday! :D Quote
oracid Posted January 15, 2024 Posted January 15, 2024 6 hours ago, glowytheglowbug said: is there a way to use full 360 degrees of motion? Of course ! It is what I have done here, GeekServo - real 360° - Programming - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums Yes, the Doggo and my quadrupeds are based on the same mechanical principle. Quote
glowytheglowbug Posted January 15, 2024 Author Posted January 15, 2024 (edited) 3 hours ago, oracid said: Of course ! It is what I have done here, GeekServo - real 360° - Programming - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums Yes, the Doggo and my quadrupeds are based on the same mechanical principle. oh no i meant have the legs sort of do a Y shape eg this (what my bot is based off) basically have them go up past the 180 mark and then lower down Edited January 15, 2024 by glowytheglowbug Quote
oracid Posted January 15, 2024 Posted January 15, 2024 In my quadrupeds the leg is a diamond. So with 4 equal sides. Whereas the Doggo is a kite. With equal sides 2 by 2. If I limit my servos to 180°, it is because of the structure of the chassis which abuts against the femurs. You have to make choices, that’s one of them. Quote
glowytheglowbug Posted January 15, 2024 Author Posted January 15, 2024 (edited) 13 hours ago, oracid said: In my quadrupeds the leg is a diamond. So with 4 equal sides. Whereas the Doggo is a kite. With equal sides 2 by 2. If I limit my servos to 180°, it is because of the structure of the chassis which abuts against the femurs. You have to make choices, that’s one of them. ah thanks! I was also trying to figure out the maths for calculating servo angles above 180 and since I have a 1.4:1 gearing my servos rotate clockwise instead of the anticlockwise that's in your video, also when calculating the servo angles I cant set G=0 as it gives me undefined and thus does not work? thanks to moki on discord for helping me with this :Dhttps://www.desmos.com/calculator/mebnf5olnw seems like this works! ٩(◕‿◕)۶ now to implement it in code :/ Edited January 16, 2024 by glowytheglowbug Quote
oracid Posted January 16, 2024 Posted January 16, 2024 (edited) As you can see in this post, upper, there is no need to divide by G. Edited January 16, 2024 by oracid Quote
glowytheglowbug Posted January 17, 2024 Author Posted January 17, 2024 7 hours ago, oracid said: As you can see in this post, upper, there is no need to divide by G. Oh thanks! Could I also use the Desmos calculator? And how do I adjust the values for each side of the quadruped eg LR, FR, BR, BL? Quote
oracid Posted January 17, 2024 Posted January 17, 2024 (edited) 7 hours ago, glowytheglowbug said: And how do I adjust the values for each side of the quadruped eg LR, FR, BR, BL? I don't understand your question. Why don't you refer to my code ? In each video, in description, you have the link of the code on Github. Of course, you can use Desmos. I don't know Desmos. It looks very similar to GeoGebra. I have done some draws with GeoGebra. Here a kind of thing you can do. Grab the point P with the mouse and move it. https://www.geogebra.org/m/cj6gsatg Edited January 17, 2024 by oracid Quote
glowytheglowbug Posted January 17, 2024 Author Posted January 17, 2024 16 hours ago, oracid said: ooh thanks, the main thing with mine was the lower sections were longer than the top arms (connected to servos) so there's more linear travel, but I need to adjust the servos for that. i think software wise it should be solvable thanks! also I have gotten a Nrf24l01 smd (transciever) and its kind of tiny its for controlling the arduino from a raspberry pi pico Quote
oracid Posted January 18, 2024 Posted January 18, 2024 I don't understand what exactly you want to do. Anyway, here is a board with an RP2040 (like the Pico) wich seems very interesting. Servo 2040 - 18 Channel Servo Controller (pimoroni.com) Quote
glowytheglowbug Posted January 18, 2024 Author Posted January 18, 2024 1 hour ago, oracid said: Servo 2040 - 18 Channel Servo Controller (pimoroni.com) Does this mean a 5 or 6 dof robot? XD would love to see how that works! maybe with robot arm on dog too :D Also, I'll be using your code as a reference, it's just that when I look at code it takes me a while to figure out how it works XD It's not helping that I have minimal knowledge of c and mainly use Python to code. Thanks for your help so far! Quote
oracid Posted January 18, 2024 Posted January 18, 2024 33 minutes ago, glowytheglowbug said: Does this mean a 5 or 6 dof robot? XD would love to see how that works! maybe with robot arm on dog too :D For now, the best is to start with a 8 DOF quadruped. This means 2 DOF for each leg. About the code, may be you can refer to this quadruped, 5BQE-2 Quadruped robot - new version - LEGO Technic, Mindstorms, Model Team and Scale Modeling - Eurobricks Forums The code link is in video description, but I put it again here : 5BQE2-5Bars-Quadruped-with-extension/5BQE-2.ino at main · oracid/5BQE2-5Bars-Quadruped-with-extension · GitHub This code is in C but I say it is very simple. It is 100 lignes code, but forget the Inverse Kinematics function. That make less than 60 lignes code. - At the biginning, there is servos tuning. Then data of the gait. - Then, in setup() function, there is servos initialization. Forget it. - Then in the loop() function, you can see the call to the Walk() function. - Then the Walk() function itself, it is the main point. It allows to go forward, backward, turn left and turn right. Please, tell me which point you want to discuss about. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.