PDA

View Full Version : [Question(s)] Smooth motion using EX106, RX64



vinjk
07-23-2012, 11:12 PM
Hello everyone,

I have been working on a robotic arm project. We are using Dynamixel EX106 and RX-64 motors for the arm. I have interfaced the motors to the PC using USB2Dynamixel. I'm programming in C/C++. The arm moves to the points I want it to move but the movement really jerky.

If I move the end point of the arm along a series of points, at each intermediate point it stops abruptly which makes the entire arm shake.

1. I tried the compliance feature in the dynamixel that doesnt seem to help.

2. I reduced the speed of each motor to 3rpm not much improvement. Below 3rpm the movement was really bad.

3. I tried to decelerate the speed as it approaches the point. I did it by calculating the time reqd to move to the point based on the angle each motor has to cover. then for 0.33 of the time i increased the speed 1rpm a sec and stabilzed the speed for the next 0.33*time and then decreased the speed 1rpm a sec the final 0.33*time. I am not sure whether is a better method to implement a speed curve. Please help if you know a better one. Anyway this didnt help either.

Can anyone help me with this problem? I want the movement to be smooth and non-jerky

Can the mechanical design of the arm lead to this problem? How about the weight of the arm? How much load can a EX106 and RX-64 lift? I am not a mechanical engineer but I feel the excess play at the joints can be compensated through the control software. Or is that too much to expect from the software?

Th232
07-23-2012, 11:57 PM
What are the distances like between one point and the next, and how often are you updating the servo positions?

vinjk
07-24-2012, 01:32 AM
Distance can be anything as I set the end-point co-ordinates of the arm along a line with different distance between each points. The distance for the motors can be as low as 50 counts to upto 500 counts.

I give the points to be reached at the start of the motion. after the arm reaches one point, the next target point is updated.

I hope this answers your questions

What are the distances like between one point and the next, and how often are you updating the servo positions?

Th232
07-24-2012, 02:15 AM
Not quite the answers I'm looking for. That said, it seems like you're not doing any interpolation in your movement. I'd recommend breaking down your movements a lot more. Here're two examples:

In case number 1, you tell a servo to turn by 10 degrees, then half a second later tell it to turn by another 10 degrees.
In case number 2, you tell a servo to turn by only 1 degree, 50 ms later tell it to turn another degree and so on until it's turned 20 degrees.

You want to be doing the second (or even smaller angle changes).

To give a couple of basic analogies (it's 5:15 pm here so I'm a bit tired of thinking), consider integration using the rectangle method. The thinner you make the rectangles, the more accurate your final result is going to be. If you're driving a car, it's better to make 10 small course corrections along the highway rather than one big one (assuming you haven't crashed by that point). Finer resolution is better.

On your attempts to gradually decelerate the arm, you're on the right track, but not quite there. I'm not entirely sure what you mean by increase/decrease the speed by 1 rpm per second (1 revolution per minute per second?). That said, here's where my note about a finer resolution comes in. If your speed changes from 3 rpm to 2 rpm to 1 rpm, at the end there's still a change of 1 rpm that the arm has to go through at the end of its motion. There may also be sudden jerks as it goes from 3 to 2 and 2 to 1 rpm. If you decrease it further so that it's 1 rpm to 0.5 rpm, then you've halved the (probably sudden) deceleration at the end.

A smooth motion consists of smooth changes in velocity, both magnitude and direction. If that's impossible (and being a digital control system, it kinda is) then you need to make the steps as small as possible.

Aaaand I'm going to stop now since I'm not thinking straight...

Out of curiosity, what's your control logic for the arm look like? Do you have the inverse kinematics of the arm, or is this just forward kinematics?

vinjk
07-24-2012, 03:04 AM
Thanks for your reply.

I am using the inverse kinematics of the arm.

I did the same thing! I broke down the motion of each motor into step (the number of step was decided based on the amount of time to complete that movement). Same for the speed. However, the movement wasnt smooth. Now that you've confirmed that this is the way to go about, I think the problem lies in the timing.

How do you ensure that the next step is made in 50 or 10ms?

Another problem I had while trying this step-wise motion was that below a certain step size the movement becoming worse. Is that a something you've observed in your work?


Not quite the answers I'm looking for. That said, it seems like you're not doing any interpolation in your movement. I'd recommend breaking down your movements a lot more. Here're two examples:

In case number 1, you tell a servo to turn by 10 degrees, then half a second later tell it to turn by another 10 degrees.
In case number 2, you tell a servo to turn by only 1 degree, 50 ms later tell it to turn another degree and so on until it's turned 20 degrees.

You want to be doing the second (or even smaller angle changes).

To give a couple of basic analogies (it's 5:15 pm here so I'm a bit tired of thinking), consider integration using the rectangle method. The thinner you make the rectangles, the more accurate your final result is going to be. If you're driving a car, it's better to make 10 small course corrections along the highway rather than one big one (assuming you haven't crashed by that point). Finer resolution is better.

On your attempts to gradually decelerate the arm, you're on the right track, but not quite there. I'm not entirely sure what you mean by increase/decrease the speed by 1 rpm per second (1 revolution per minute per second?). That said, here's where my note about a finer resolution comes in. If your speed changes from 3 rpm to 2 rpm to 1 rpm, at the end there's still a change of 1 rpm that the arm has to go through at the end of its motion. There may also be sudden jerks as it goes from 3 to 2 and 2 to 1 rpm. If you decrease it further so that it's 1 rpm to 0.5 rpm, then you've halved the (probably sudden) deceleration at the end.

A smooth motion consists of smooth changes in velocity, both magnitude and direction. If that's impossible (and being a digital control system, it kinda is) then you need to make the steps as small as possible.

Aaaand I'm going to stop now since I'm not thinking straight...

Out of curiosity, what's your control logic for the arm look like? Do you have the inverse kinematics of the arm, or is this just forward kinematics?

vinjk
07-24-2012, 03:26 AM
Just to add...the smallest step I could do without affecting the performance was 3 deg.

Th232
07-24-2012, 04:10 AM
As a starting point, use a timer function to see how long your calculations take and how much variation in those times there are.

Regarding the timing itself, timer based interrupts will probably be your friend here. Once you know how long your calculations take you can decide on a suitable frequency for the interrupts. A rough method that I've also used is to just determine how long your calculations take and then write a suitably sized delay into the code so that the time taken for the two adds up to your desired total. That may be suitable if there's not much else in your code, but if there're other functions that take irregular amounts of time to run then it may break down.

This may all be getting unnecessarily complex though, so I'm hoping one of the more experienced members will also chime in here. I may be completely off base or there might be an easier method out there.

Unsure about what went wrong as you made your step size under 3 degrees, not much help there I'm afraid.

vinjk
07-24-2012, 07:12 AM
I will try out with the timer. Let me see how it goes...

thanks!


As a starting point, use a timer function to see how long your calculations take and how much variation in those times there are.

Regarding the timing itself, timer based interrupts will probably be your friend here. Once you know how long your calculations take you can decide on a suitable frequency for the interrupts. A rough method that I've also used is to just determine how long your calculations take and then write a suitably sized delay into the code so that the time taken for the two adds up to your desired total. That may be suitable if there's not much else in your code, but if there're other functions that take irregular amounts of time to run then it may break down.

This may all be getting unnecessarily complex though, so I'm hoping one of the more experienced members will also chime in here. I may be completely off base or there might be an easier method out there.

Unsure about what went wrong as you made your step size under 3 degrees, not much help there I'm afraid.

vinjk
07-27-2012, 02:20 AM
Hey Th232,

Once I started focusing on the timing, the movement is much smoother now. Thanks all lot for the tip. I need to work on my code a bit more

Th232
07-27-2012, 03:02 AM
Awesome, glad it worked out! Has the sub 3 degree step issue been solved with it?