Joystick Inverse Kinematic Robot Arm

Hai guys, my project is to use two wireless joysticks to control robot arm using inverse kinematic method. I know that the joysticks will control the position of P instead of theta 1 and 2, with the robot arm image attached below. What I want to do is if I move the joystick 1 up (vertical axis), the end effector (P) will just move along the x axis as long as I hold my stick up, and vice versa. If I move joystick 2 up (vertical axis), the end effector will just move along the y axis as shown in the picture. Basically both of my joysticks will determine the how long the arm will move along either the x and y axis as long as I push my joystick upward and downward. Is it possible to do this? What joystick would you suggest? And how do I convert the movement of joystick into the x and y coordinate to calculate theta? Any help will be appreciated

Is it possible to do this?

For some amount of movement of the joystick, yes. At some point, you will move point P beyond the ability of the robot to reach the point, at which time the answer becomes no (obviously).

The first issue, as I see them are that you have no clue how to relate the position of the point P to the position of the joystick, because you have no concept of how fast P should move, or when.

The second issue is that you don't seem to understand how to solve for the joint angles given any point P.

What joystick would you suggest?

That's a bit like asking what color seats you should get for a car that you have no idea how to drive, can not afford, and have no place to park.

The model of joystick is really irrelevant.

And how do I convert the movement of joystick into the x and y coordinate to calculate theta?

You need to tell us that. What does a reading of 250 from the x axis of the joystick mean that you will do to the X coordinate of P? When will you do that?

Personally, I'd suggest that you ditch the joystick idea, and connect the robot arm to a PC. Write a program to output joint angles based on the mouse cursor position in a window. That way, someone that understands time and motion will have taken care of the conversion of motion to position for you.

Thank you before for your suggestion. Here's my project : I am building a tank with a robot arm (like an excavator), and I need to control it wirelessly. So far, I manage to control the tank using RC Transmitter and arduino + motor driver. Since the transmitter only has 4 channel (I have used 2 for tank movement) and the robot arm has 5 servos, I was thinking of adding either Xbox or PS2 wireless controller. I was thinking of using forward kinematic for the robot arm (the joystick or button directly control each servo angle individually. But apparently, my lecturer told me to use inverse kinematic instead, to make the project more intuitive. I actually know how to calculate each theta given the positiion of P. My main problem is how do I "convert" the formula to language programming for Arduino to automatically compute the theta given the position of P. I mean, surely you dont simply copy and paste the whole formula right? Perhaps you have to put something like "float" or anything? I made simulation using Excel though to calculate theta if I input the x and y coordinates, and it worked. Excel gave me theta 1 and 2.

Lets just say the joystick neutral point is 128, min point is 0 and max point is 255. If I move the joystick upward towards 255, P will move forward along the x axis until it reached its max range. It doesnt matter what point, as long as the joystick is more than 128 to 255, P will move forward with constant speed, and will go backward if I move the joystick between 128 and 0. The joystick will be more like a "switch" to command P move forward or backward with constant speed

So you want the joystick to be more like buttons the. You don't care if joystick is at 130 or 255, it just means move in that direction and don't stop until the max position is reached?? Then don't use a joystick, use a button. You will need to define an arbitrary speed of the point P, calculate the coordinates Px and Py of your point P in real space based on previous position and delta time and speed then you use this to calculate with the formulas you have the angles.

If you use 2 joysticks the 0-255 or whatever 0-1023 value you read from it should be transformed intuitively into the coordinates Px and Py of your point P in real space (mapping the joystick analog value into real world coordinates), then you use this to calculate with the formulas you have the angles.

If you give us the formulas you want, we can tell you how to write that in code, but that is quite straightforward once you have the coordinates Px and Py. You just need to be clear on what drives the change of position of P: is that time and direction indication or is that relative position of the joystick (which would be more intuitive, as max joystick position would mean max P extension in that direction)

This simple joystick - servo demo may do what you want.

If you were to use nRF24L01+ wireless transceivers to control your model you could data for as many different actions as you need. Simple nRF24L01+ Tutorial

...R

@JML
Now that you mention it, I think mapping the joystick analog value into real world coordinates will be better. So, I prefer transforming the coordinates of x and y value of joystick into x and y coordinates of real life P. Here's the formula and the drawing of the robot arm. Given the length of the first link L1 is 10 cm and the length of the second Link L2 is also 10 cm, with x and y relative to the joystick position as input. I was thinking of using a button to lock and release the position of P so that P will not be affected due to the joystick being back to neutral position when not in use. Assuming the joystick has a value of 0-255 with 128 being neutral. Thanks in advance :slight_smile:

@Robin2
Thanks, I'll have a look. :slight_smile: