Replies: 6 comments 1 reply
-
Yes, absolutely. I mentioned this on Discord as well, but I would be excited to help with KI. I have plans to add feedback and PI control as well! |
Beta Was this translation helpful? Give feedback.
-
Okay, got it! I've been working on learning IK and getting a handle on how all the files work together for Arduino. The process has been a bit slow, but I'm doing my best. Once I fully understand IK, I'll start making some improvements. Anyway, thanks again for all the effort you've put into it 🙂 |
Beta Was this translation helpful? Give feedback.
-
Thanks both. It would be good to collaborate on this so please keep posting your learnings, any changes you're working on, and any questions you have. GitHub allows you to 'fork' the repository, make changes and commit them, then create a pull request (PR) back into this main repo. It means we can collaborate and review changes easily. Please feel free to make use of it for this discussion - you can even create 'draft' PRs if you just want to show the work to us rather than requesting a merge. @EngineerJoe2016 you mentioned using the algebraic method. I'm not familiar with that - can you share any resources? |
Beta Was this translation helpful? Give feedback.
-
I created a roadmap with ideas about changes we could make: Issues with the Current IK Algorithm:Simplified IK: The code uses a simplified approach based on leg height rather than a complete inverse kinematics solution. This prevents the robot from stepping or performing complex movements. Slow Computation: The Limited Range of Motion: The algorithm cannot use the full range of motion of the legs, which restricts the robot's potential movements. Suggestions for Improvement: Switch to Full IK Algorithm: Instead of the simplified approach, consider using a more advanced and efficient IK algorithm, such as FABRIK (Forward And Backward Reaching Inverse Kinematics). FABRIK is computationally efficient and can utilize the full range of leg movement. It also yields reasonable results even when the target is out of reach. Increase Computation Speed: To optimize IK calculations, use lookup tables or precomputed values. Additionally, consider faster approximation methods in place of trigonometric functions. Reducing computational cost is essential due to the limited processing power of Arduino. Motion Planning: To make the robot's movements smoother and more realistic, a motion planning algorithm can be added. This would allow the robot to plan its steps in advance and perform movements more coherently. PI Control: As suggested by @KeahiXie, adding PI control can enhance the precision and stability of the robot's movements, which is particularly important for robustness against external factors. Additional Notes on the Code:
To proceed, start by working on implementing a full IK algorithm like FABRIK. This will significantly improve the robot's movements. Then, tackle other optimizations like performance improvements and motion planning. InverseKinematics.h2D IK: The Angle Limits: The
Trigonometric Functions: Functions like Constants: Constants like Config.h:Servo Calibration: The Position Arrays: Arrays like NOVAL Macro: The Mpu6050.hMPU6050 Initialization: The MPU6050 sensor initializes within the General Suggestions:Modularity: Breaking down functions into smaller, specialized parts would enhance code readability, maintenance, and reusability. Comments: There are few comments in the code, and existing ones lack detail. Adding more descriptive comments explaining different sections of the code will make it easier to understand. Implementing these improvements will enhance code quality and performance. Specifically, applying a full 3D IK solution will greatly improve the robot’s movement capabilities. Roadmap for Implementation:1. Implementing the FABRIK Algorithm:
2. Performance Optimization:
3. Code Enhancements:
|
Beta Was this translation helpful? Give feedback.
-
@SentryCoderDev thanks for the details, it's good but I'm a little confused on the direction you defined. I do think that we can follow Dan's suggestion and create forks for this portion of the code and work to demonstrate it to the community. @danic85, at least from my time studying robotics you have many different ways to calculate the end-effector positions. But in terms of math, normally it comes down to either the geometric method or the algebraic method. Now I guess there is a third method(ish) as well, FABRIK. The geometric method is what a lot of people tend to use that are new to robotics, geometry is good for small-scale robot arms, but when you increase joint counts and complex dimensions, it can get nasty real fast. The algebraic method uses linear algebra, specifically matrices and transforms as it translates well to 3D driven calculations. With this method, you can feed the end-effector coordinates into the matrix and it will back calculate your joint positions as needed. Plus you can build in limitations and specific paths for your robot to take; as I said above you can link multiple KI equations together as well. I have some links below to help explain it a little more. I do plan on providing write ups for the equations I create. Look at section 3.2.1 vs 3.2.2 wiki: https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant For the community, I am not trying to push one method over another. I just like linear algebra, as it's what I was taught and I want to see what I can do. As a Note: EngineerJoe2016 <-> CriminialJoe (Discord) |
Beta Was this translation helpful? Give feedback.
-
Thanks @EngineerJoe2016 ! I'll take a look at those resources. Feel free to share your write ups etc here when you have it - and let me know if you need any support. |
Beta Was this translation helpful? Give feedback.
-
Congratulations @KeahiXie, you discovered my secret! The IK algorithm in the arduino sketch is not my finest hour, and here's why:
In truth it hasn't been a priority (yet), but I have been hoping that someone with a good understanding of IK would like the challenge of improving it and contributing some much needed changes to the project.
Do you know anyone who fits that description? (hint hint 😉 )
I'm more than happy (excited, even) to collaborate on it, if that's something you'd be up for.
Beta Was this translation helpful? Give feedback.
All reactions