Inverse kinematics library for LSS drawing arm

Hi!

I require your help regarding a problem I’m encountering.

Description: Looking for advice.
I am implementing a python script that controls a LM LSS 4 dof drawing arm. The aim is to take 2D coords from the screen (tkinter canvas and mouse event) and tracks that into the robot arm to draw onto a piece of paper positioned at the base of the arm.

Which python code/libraries do you recommend to control the inverse kinematics?

Hardware concerned: Lynxmotion LSS 4 of arm

Software concerned: Python

Troubleshooting steps already taken: have all the code ready, just need a simple and clean way of translating the IK. Tried simple range-scale conversion for each servo, but I know there is a more elegant way.

Additional information: Apologies if this duplicates existing thread - but I couldn’t find anything current.

Thank you so much in advance for your help!

1 Like

Not sure there’s a library for IK for Python, but if there is, the communication protocol is simple enough to easily adapt the output angles to LSS protocol format. You might consider using EM0 which allows you to “spam” positions to have many intermediate points rather than using EM1 which takes care of everything from start to finish.

Didn’t go through your other posts, but you’re likely already aware of:

@geraldinebc15 did a great tutorial about getting the arm set up for chess and is great at Python (mentioning her here to perhaps grab her attention).

See step 3 here, and the code is available.

A few issues with the arm and drawing nicely which will need to be overcome:

  • Depending on which version of the servo you have, there may or may not be some “play” between the output spline of the servo and the horn, which decreases the accuracy. This can be overcome using something like Loctite between the two, but even a drop makes the horn hard to remove afterwards.
  • There is an effect of inertia and sudden starts and stops, to take that into consideration when moving the arm
  • If you’re just drawing, consider removing the gripper servo and gripper and replace it with a pen holder like a 3D printed SES compatible pen holder under SES - Miscellaneous:
    https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-mechanics/
    This weight reduction will lead to better accuracy.
4 Likes

Thank you. Will look at those. Appreciated

Further:
Thanks to @geraldinebc15 for the chess code. Very clean and clear. Easy to understand, and perfect for my experiments.

1 Like

Hi @craigvear!

Your project sounds like fun, I hope you’ll be sharing the results here :smiley:

You’re welcome :sweat_smile: I’m glad my code can help you with your project!

Also, feel free to ask me if you need help with anything or if you don’t understand any part of the code.

3 Likes

I know this was resolved already, but just for future searches from others about this, here are some interesting links:

Sincerely,

2 Likes

HI @geraldinebc15

thank you. there seems to be a function missing in your lss.py (there is also an open issue on Github with the same problem). I can’t find reference to the function setFilterPositionCount() e.g.

shoulder.setFilterPositionCount(15)
elbow.setFilterPositionCount(15) 

regards
craig

1 Like

Oops, seems like I forgot to update the lss.py haha

Simply add this:

def setFilterPositionCount(self, value):

        return (genericWrite(self.servoID, lssc.LSS_FilterPositionCount, value)) 

And this to lss_const.py

LSS_FilterPositionCount = "FPC"

I just updated the repository so you can also simply pull it again :smiley:

2 Likes