Results 1 to 5 of 5

Thread: Conversion between angle and position values

  1. Conversion between angle and position values

    Hi, I have question about converting between rotational angle in degree and positional values accepted by dynamixel.

    I have not built a robot but different motors can be oriented differently (e.g. horn on top of the dynamixel label and vice versa). If the dynamixel accepts values between 0 and 4095 and 2048 means 180 degrees, what is the positional values for 0 and 360 degrees if turning like a wheel is not needed?


    By calculation: 90 degrees = 1024, 270 degrees = 3072, 360 degrees = 4096 which is outside the range of [0, 4095]. Is 0 degree = 0 positional value, 360 degrees = 4095 position value even by calculation, it should correspond to 4096?


  2. #2

    Re: Conversion between angle and position values

    The 360 degree position is valued at 0. Unfortunately, you can't actually get QUITE to that position -- you'll get to (4095*360/4096) degrees. Protocol 2.0 has a "multi-turn" mode that may help if you need to "push" it from 359 to 0 without going all the way back.
    When there is not multi-turn, the classic way to do it is to turn on wheel mode, push it across the limit, then turn it back to position mode once it's on the other side.

  3. Re: Conversion between angle and position values

    Thanks jwatte. My simulator has 0 as the center and +- value degrees to indicate the amount of turning and whether it is turning clockwise or counter-clockwise.

    In previous projects, I used standard RC servo motors with 90 degrees in the middle. So I just wrote a function to add 90 as an offset to whatever values from the simulator to make the motors turned accordingly.

    With such workflow and the use of dynamixel as the motors, do you still recommend to turn on the wheel mode rather than use the position control mode?

  4. #4

    Re: Conversion between angle and position values

    Unless you truly need 360 degrees of motion (not 359.9) you don't need wheel mode.
    You should just center the formula for "sent parameter from desired angle" at 0 degrees == 2048 sent parameter. This isn't that different from centering 90 degrees at 1500 microseconds for a hobby servo.

    This brings up an important point: For success in robotics (and STEM in general,) I've found that making simple algebraic equivalencies second nature, similar to addition, in my head, is super important.
    This comes in helpful for things like Ohm's law, as well as torque and load calculations, as well as translation tables. (It also comes in helpful for computer graphics, and a bunch of other areas.)
    The linear equation parameters that you want in this case is "0 control value at -180 degrees" and "2048 control value at 0 degrees" (and an implicit "4095 control value at +179.9 degrees")
    Plugging those values into the linear formula y = kx + b and rearranging the terms to get the scalling/addition factors you need, should be second nature, a thing I do in my head. Before I got to that point, I had a much harder time working with these things!
    Last edited by jwatte; 08-06-2020 at 12:37 PM.

  5. Re: Conversion between angle and position values

    Quote Originally Posted by jwatte View Post
    Unless you truly need 360 degrees of motion (not 359.9) you don't need wheel mode.
    You should just center the formula for "sent parameter from desired angle" at 0 degrees == 2048 sent parameter. This isn't that different from centering 90 degrees at 1500 microseconds for a hobby servo.

    This brings up an important point: For success in robotics (and STEM in general,) I've found that making simple algebraic equivalencies second nature, similar to addition, in my head, is super important.
    This comes in helpful for things like Ohm's law, as well as torque and load calculations, as well as translation tables. (It also comes in helpful for computer graphics, and a bunch of other areas.)
    The linear equation parameters that you want in this case is "0 control value at -180 degrees" and "2048 control value at 0 degrees" (and an implicit "4095 control value at +179.9 degrees")
    Plugging those values into the linear formula y = kx + b and rearranging the terms to get the scalling/addition factors you need, should be second nature, a thing I do in my head. Before I got to that point, I had a much harder time working with these things!
    Thank you.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question(s) Unable to read AX12 servo position values during Interrupt Service Routine using arbotix.
    By rishflab in forum DYNAMIXEL & Robot Actuators
    Replies: 3
    Last Post: 04-29-2016, 07:23 PM
  2. Project MX-12W to a MX-12A Conversion
    By vehemens in forum DYNAMIXEL & Robot Actuators
    Replies: 5
    Last Post: 12-08-2014, 09:36 PM
  3. L3G4200D Gyroscope _ Measuring Angle!?
    By Jigar4Electronics in forum Sensors
    Replies: 3
    Last Post: 08-22-2013, 12:28 AM
  4. Angle precision Errors in IMU
    By Jigar4Electronics in forum Software and Programming
    Replies: 1
    Last Post: 03-22-2013, 01:21 PM
  5. Question(s) Reading Wrong Position Values from AX-12 (C++)
    By robotpanda in forum Software and Programming
    Replies: 4
    Last Post: 05-12-2012, 09:30 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
  •