Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Easy way to smooth Dynamixel Start/Stop motion?

  1. Re: Easy way to smooth Dynamixel Start/Stop motion?

    Quote Originally Posted by jwatte View Post
    You don't want a while() loop.
    You want all real-time control systems to work by running the main loop over and over, and only react to "what time is it" and "what inputs changed."
    If you are using the Arduino environment, check out a sample called "blink without delay" for how to do that.
    I'm using usb2ax so direct serial communication

  2. #12

    Re: Easy way to smooth Dynamixel Start/Stop motion?

    The basic idea is the same:

    Code:
    int main() {
    setup();
    while (true) {
      loop();
    }
    }
    
    long lastTime = 0;
    
    void loop() {
      long time = millis();
      if (time - lastTime >= 10) {
        calculateNewPosition(time);
        lastTime = time;
      }
    }
    To generate the movement profile, you typically want to store the "start position," "start time," "target position," and "last sent position" for each servo.
    When you update, calculate "how long after the start time am I now? where do I want to be based on that? That's my new send-position."

  3. Re: Easy way to smooth Dynamixel Start/Stop motion?

    Quote Originally Posted by jwatte View Post
    The basic idea is the same:

    Code:
    int main() {
    setup();
    while (true) {
      loop();
    }
    }
    
    long lastTime = 0;
    
    void loop() {
      long time = millis();
      if (time - lastTime >= 10) {
        calculateNewPosition(time);
        lastTime = time;
      }
    }
    To generate the movement profile, you typically want to store the "start position," "start time," "target position," and "last sent position" for each servo.
    When you update, calculate "how long after the start time am I now? where do I want to be based on that? That's my new send-position."
    So would calculateNewPosition function include something like sin? How would I create a function that maps time passed to a sinusoidal velocity profile? Also, would it work best to apply this individually to only the start/stop acceleration and (With a constant velocity in between stop/start positions) or map the whole motion to a sinusoidal velocity profile?
    Last edited by memmerich; 12-16-2016 at 07:27 PM.

  4. #14

    Re: Easy way to smooth Dynamixel Start/Stop motion?

    Quote Originally Posted by memmerich View Post
    So would calculateNewPosition function include something like sin? How would I create a function that maps time passed to a sinusoidal velocity profile? Also, would it work best to apply this individually to only the start/stop acceleration and (With a constant velocity in between stop/start positions) or map the whole motion to a sinusoidal velocity profile?
    It could, although usually, it will just be a trapezoidal value. (The closer you are to each end point, the slower you go, with some clamp to the maximum velocity allowed.)
    Note that you can map either time, or position, to the desired velocity. Mapping current-position to desired-velocity requires almost no math, but the exact behavior will then depend on the time step size. (The math reason for this is that it ends up being a discrete simulation of a differential equation.)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to make beautiful, smooth cut of curved shapes made of EVA foam?
    By Snoopy in forum Mechanics / Construction
    Replies: 2
    Last Post: 12-11-2015, 06:07 PM
  2. Question(s) Smooth motion using EX106, RX64
    By vinjk in forum DYNAMIXEL & Robot Actuators
    Replies: 9
    Last Post: 07-27-2012, 04:02 AM
  3. Question(s) Motion sequencing in RoboPlus Motion?
    By jarred in forum Software and Programming
    Replies: 4
    Last Post: 05-07-2010, 09:54 AM
  4. Most Creative Stop-Motion Robot Vid
    By tom_chang79 in forum Robotics General Discussion
    Replies: 3
    Last Post: 09-07-2009, 06:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •