Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent height when moving with constant Z values. #2

Open
franz6ko opened this issue Oct 28, 2022 · 10 comments
Open

Inconsistent height when moving with constant Z values. #2

franz6ko opened this issue Oct 28, 2022 · 10 comments

Comments

@franz6ko
Copy link

franz6ko commented Oct 28, 2022

Hi!

I'm using this library for a project involving a delta robot and computer vision. I'm trying to move the end effector on a horizontal plane by maintaining a constant z and giving different xy commands. However, it descends the more it gets farther from the center.

At first, I thought it was something about my code or the servos calibrations but I did tons of tests and the behavior is the same. So I did a bit more research on the web and I found a repo of @isaac879 with inverse kinematics functions for a delta robot. I tried those out and it works like a charm! Now my robot moves perfectly well on a horizontal plane.

So maybe there's something wrong with the code or the mathematical approach. I wanted to notice this as this is a well-known library and it would be great to have it fixed.

Link to the repo: https://github.com/isaac879/Delta-Robot
(check out the delta_robot/deltaRobot.cpp file from line 69)

@tinkersprojects
Copy link
Owner

tinkersprojects commented Oct 31, 2022 via email

@WideAwakeTN
Copy link
Contributor

WideAwakeTN commented Dec 22, 2022

In case all angles are 0 degress the z coordinate is given by the following simple formula according to the Pythagoras theorem:
z = -sqrt[ (RodLength)² - (PlatformTri + ArmLength - BassTri)² ]
But the code of this repo returns a different value for the FK. Since the IK is consistent with the FK the IK is (equally) wrong too. Seems there is an implementation error hiding somewhere.
The values of x and y should be zero in this example.

@nicolasdetracy
Copy link

Hi,

I'm encountering the same problem as explained in this issue.
How can I fix this issue?

Kind Regards,
Nicolas de Tracy

@tinkersprojects
Copy link
Owner

can you send your code through to me soo i can review it. there is many different ways of calulating it and it may come down to an edge case that the function does not work.
i need to see your numbers and how you got there soo i can fix it

@nicolasdetracy
Copy link

nicolasdetracy commented Nov 26, 2023

This is the inverse kinematics part of my code:

`
#include "DeltaKinematics.h"

DeltaKinematics DK(150, 350, 55, 115);

void setup() {
// move to point 1 (x = -120, y = 0, z = -380)
DK.inverse(-120, 0, -380);
moveMotors(DK.a, DK.b, DK.c);
delay(1000);

// move to point 2 (x = 0, y = 0, z = -380)
DK.inverse(0, 0, -380);
moveMotors(DK.a, DK.b, DK.c);
delay(1000);

// move to point 3 (x = 120, y = 0, z = -380)
DK.inverse(120, 0, -380);
moveMotors(DK.a, DK.b, DK.c);
delay(1000);
}

void loop() {}
`

These 3 moves should move the end effector to 3 different points on the x-axis with the same z-axis value.
But the end effector actually descends the more it gets further from the center in real-life.

Thanks for wanting to take a look at this problem.
Kind regards,
Nicolas de Tracy

@tinkersprojects
Copy link
Owner

thank you, i will look at this, may take a while, need to dig up my old notes

also please note, this will only calculate the final position. you may get some movement in Z as it is moving

@nicolasdetracy
Copy link

Thank you for your willingness to help!
Yes, I understand that this calculates the final position and may get some movement in Z as it's moving.

Nicolas de Tracy

@nicolasdetracy
Copy link

Hi, have you had any luck finding the problem to our issue?

Nicolas de Tracy

@nicolasdetracy
Copy link

fixed the problems by creating my own library, which works very differently that all the other ones. The end effector moves around with an amazing accuracy and no changes in height at all.

Link to repo: https://github.com/nicolasdetracy/deltaRobot_Inverse_Kinematics

@PROG-MohamedDwidar
Copy link

the repo is private or removed mr nicolas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants