by cosa » Thu Nov 27, 2008 5:03 am
by cosa
Thu Nov 27, 2008 5:03 am
How would this work? You have to have different speeds on each servo in order to have all the servos reach the destination at the same time, and in order to ever implement an S-curve, you'd have to adjust the speed continually during the ramps, right?
You can control the average speed of the servo by sending position values to it. If you assume/set a pretty high acceleration/speed the servo will be able to reach every position within a few milliseconds. Then the average speed just depends on the position values you send in a specific time frame (f.e. the values 100 101 102 will be slower than 100 200 300). Of course, the problem is, that the ax-12 controller tries to reach every position with a fixed acceleration and max velocity which results in a jerky motion. But the higher your update frequency is the smaller the error of the resulting trajectory will be. Therefore you can limit the jerk by using small timesteps and a smooth precalculated trajectory (which should take the dynamics into account).
For me, a timestep of ~10ms, a smooth trajectory (f.e. cubic spline or s-curve) and (optional) a simple pid controller for the torque value works okay, but I don't want to draw straight lines.
I don't have up-to-date videos but you can find a few old ones
here.
You'll get better results if you take the dynamics into account and calculate "correct" position, speed and torque values but it's not that easy (and you'd need information about how the ax-12 controller works). Using max torque and max velocity has the advantage that you can't underestimate the values
How would this work? You have to have different speeds on each servo in order to have all the servos reach the destination at the same time, and in order to ever implement an S-curve, you'd have to adjust the speed continually during the ramps, right?
You can control the average speed of the servo by sending position values to it. If you assume/set a pretty high acceleration/speed the servo will be able to reach every position within a few milliseconds. Then the average speed just depends on the position values you send in a specific time frame (f.e. the values 100 101 102 will be slower than 100 200 300). Of course, the problem is, that the ax-12 controller tries to reach every position with a fixed acceleration and max velocity which results in a jerky motion. But the higher your update frequency is the smaller the error of the resulting trajectory will be. Therefore you can limit the jerk by using small timesteps and a smooth precalculated trajectory (which should take the dynamics into account).
For me, a timestep of ~10ms, a smooth trajectory (f.e. cubic spline or s-curve) and (optional) a simple pid controller for the torque value works okay, but I don't want to draw straight lines.
I don't have up-to-date videos but you can find a few old ones
here.
You'll get better results if you take the dynamics into account and calculate "correct" position, speed and torque values but it's not that easy (and you'd need information about how the ax-12 controller works). Using max torque and max velocity has the advantage that you can't underestimate the values