go away spammer

Author Topic: servo sequencing software  (Read 2953 times)

0 Members and 1 Guest are viewing this topic.

Offline lukewaierTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
servo sequencing software
« on: January 28, 2014, 01:41:41 PM »
Hello,

I am looking for a way to program complex, smooth, non-linear movement sequences for 25+ hobby servos. The best solution I've found so far is VSA by Brookshire, but it is limited by a max position refresh rate of every 33 ms, which makes movements kind of jittery looking, and not smooth. I thought one option could be to use micro-controllers to record positions of a set of potentiometers, with 12-bit samples every 10 ms, and playback the sequence to the servos. I'm thinking this would achieve much better resolution and much smoother motion. I would prefer a PC software solution though. Why doesn't this exist? How do people program servo sequences? Just code in line-by-line position commands to the servos?

Thought?

Thanks,

Luke

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: servo sequencing software
« Reply #1 on: January 28, 2014, 03:27:01 PM »
First: Hobby RC servos will never be "perfectly smooth" because their PID control loops are not tuned for the kind of movement that you want. The built-in electronics is also seldom precise enough to give you more than 10 bits of resolution, and often less than that.

Second: A dedicated servo controller like the Pololu Mini Maestro 24 can control 24 servos at a time with high frame rates (at least 50 Hz, perhaps more.) You can in turn tell that servo controller what the poses are using serial communications over USB, or write them to flash in the controller.

Third: To be able to "read poses," you need servos that provide position read-back communications. Almost no hobby RC servos do this. However, hobby robotics servos do -- for example, the Dynamixel AX-12, or the Herkulex DRC-0101, are both servos in the $40 price category that provide full read-back and control capability. Those can also be programmed with both a goal position, and a goal velocity, which leads to smoother movement even at lower frame rates. Both of those lines of servos have available software that let you "pose" a system and read/record those poses, to later play them back.

Offline CJAlbertson

  • Jr. Member
  • **
  • Posts: 24
  • Helpful? 1
Re: servo sequencing software
« Reply #2 on: February 04, 2014, 01:10:49 AM »

.... I would prefer a PC software solution though. Why doesn't this exist?

How would you connect all those serves to a PC?  Better to use some kind of micro processor


Quote
How do people program servo sequences? Just code in line-by-line position commands to the servos?

For each servo you write an equation that give position as the function of time.

Then you write a loop that runs say 30 times per second.  It could run off a timer or just poll the system clock.
Either way the loop runs at 30Hz (or 5Hz or 100Hz or whatever you like)

Then inside the loop, for each servo, the software gets the time and uses your equation to convert time to position and sends that to the servo.

The trick is writing those functions.  In a typical robot you'd need to use an inverse kinematic solution.  What this does is convert (x,y,z)) space motion to servo angles.  Say you want to move the arm form (3,6,7) to (4,9,12) in one second and the arm as five servo motors.   30 times per second you figure out intermediate X,Y,Z coordinate and then the servo angles and then write to the servo to angle.   The arm then moves in a straight linear line.

Likely it is more complex because you want the arm to have zero speed at the start and end of the movement and some maximum speed at the mid point you you don't linearly interpolate step on the line (3,6,7) (4,9,12)

One more thing, before you do the move you'd want to check that you are not driving any motor after than it can go

Bottom line:  For smooth motion, your software needs to update the position of each motor many times per second.  If the motors are serially connected to make a robot arm the math gets a little complex and forces you to remember your trig and geometry.
Chris A. in So. Cal.

 


Get Your Ad Here

data_list