PDA

View Full Version : AX12 Position Interpolation question.



DC Robotic
11-24-2010, 03:00 PM
AX12 Position Interpolation question.
I have been away a while but now have come back to my AX12 quad project. I’ll start a project thread soon. I have the mechanics 90% built; enough to test. After quite a bit of thought I have decided to change to an onboard PC. The main reason for this decision is that I am getting fair at programming in C# and I do not want to spend the time to learn to do Python and Ardunio to use my Arbotix. I have a good start on a control program in C#. I can read/write to the Dynamixels and do some simple IK to plot my movements. I have built a single leg test setup to develop my IK. Attaching a pencil to the “foot” I can draw straight lines using IK and interpolation. My IK method returns the required angles(positions) for the Dynamixels. I then scale the speeds of the individual Dynamixels to have them arrive at the goal positions at (roughly) the same time. This works “OK” but is not adequate to draw a straight line. I then divide up the moves into a number of steps and command the moves inside a loop . The more steps – the smoother and truer the movement BUT also the slower. If I do not have enough steps – because the loop runs faster than the physical move – I do not reach goal positions before the next command in the loop sends a new position. Using this approach causes an [accel-run-decel] “herky-jerky” movement until I have enough steps to smooth it out. Then the speed starts to drop. So I am balancing the speed and number of interpolation steps to get the motion I want. This ends up being very smooth and accurate but a bit on the slow side. I have read through some of Infergy’s posts which state that his Arbotix sends commands at about 30Hz. How do you monitor whether a move is complete before starting a new one? I’m wondering if I can improve things by running the command loop on it’s own thread with some sort of timing signal? OR… am I approaching this wrong??
Also, does anyone know of a source for FIT-2PC’s? Their website indicates 8+week lead time. If you are using a FIT2-PC, are you happy with it? What model would you suggest?
Darrell

lnxfergy
11-24-2010, 04:24 PM
I have read through some of Infergy’s posts which state that his Arbotix sends commands at about 30Hz. How do you monitor whether a move is complete before starting a new one? I’m wondering if I can improve things by running the command loop on it’s own thread with some sort of timing signal? OR… am I approaching this wrong??

There's a couple different ways I do this.

On our NUKE-powered quads/hexes all the IK/gait/interpolation computation is done on the ArbotiX. The PC or handheld controller simply sends X/Y/rotation speeds to the ArbotiX, which then translates that into leg movements. I do typically send speeds at ~30hz. When the PC tells the ArbotiX to go to speed 0/0/0, the ArbotiX finishes the last step and stops movement. This approach with a low-level (ArbotiX) and a high-level brain (PC or human with controller) means that only the low-level brain has to maintain real-time considerations for smooth movement.

One of the newer add-ons from the ROS related NUKE code is that we keep track of odometry on-board the ArbotiX and can read back how far we've walked based on our steps. The next version of this firmware will also stop the bot if a command is not received within a specified timeout.

As for doing IK or other computation inside the PC, I again hand off the actual playback to the ArbotiX (using the pose/sequence engine). If you compute a number of poses using IK or whatnot, you can download that sequence to the ArbotiX, and then let the ArbotiX do the real-time playback.

Finally, I'm working on a more sophisticated version of the pose/sequence system for joint controllers in ArbotiX/ROS. This new system will actually pre-compute the spline parameters for a trajectory and the buffer the spline parameters onto the ArbotiX, which will sample from the splines and clear out the buffer as time passes. This has a number of advantages in both smoothness and the ability to run continuously (the previous playback system didn't have a rolling or even double buffer). I'm hoping to have this code fairly stable by the end of December.


Also, does anyone know of a source for FIT-2PC’s? Their website indicates 8+week lead time. If you are using a FIT2-PC, are you happy with it? What model would you suggest?

I bought my FitPC before they were all the rage and nearly always sold out. It's a pretty cool little computer, although I honestly haven't been using mine much lately as I've been working on larger rovers rather than walkers.

-Fergs

DC Robotic
11-24-2010, 06:02 PM
Fergs,
Thanks for the reply. I’ll try to narrow my question. Does the Arbotix send goal positions to the dynamixels at specific time intervals regardless of where the dynamixels are at in the execution of the previous goal instruction? In other words is the control completely open-loop? Or does the Arbotix have a way of knowing when a move is complete? Isn’t polling the position a slow (relatively) process?
On the one hand I could get my Arbotix working again which depends on : [Ardinio, Xbee, Python, Pypose, NUKE and now ROS/Linux]. All of which I’m really pretty much a noob.
Alternatively, I can fire up C#, and start writing code to run through a USB2Dynamixel, which seems much more direct, though this will require an onboard PC, which has it’s advantages and disadvantages. The main weight disadvantage I believe I have overcome through leg design.
Is there any documentation on how to interact with an Arbotix using something other than Pypose/NUKE? I’d like to do my own coding so that I have something I understand, and can build on.
Darrell

lnxfergy
11-25-2010, 07:25 PM
Does the Arbotix send goal positions to the dynamixels at specific time intervals regardless of where the dynamixels are at in the execution of the previous goal instruction? In other words is the control completely open-loop? Or does the Arbotix have a way of knowing when a move is complete? Isn’t polling the position a slow (relatively) process?

The ArbotiX itself doesn't have a specific form of communication -- it's all based on which firmware you've installed. The pypose/ROS firmware both work a bit differently. The PyPose/NUKE style firmware computes joint positions and then sends them at ~30hz using sync write. We don't poll the servos, because it is assumed that they reach the goal position by the time the 1/30 of a second is up (as long as you don't exceed the servo speed, this will be true except in cases of hardware failure). The ROS firmware supports a "syncread" instruction, which allows us to poll the servos a bit faster (as the FTDI chip introduces a certain amount of lag for each separate transaction).


Is there any documentation on how to interact with an Arbotix using something other than Pypose/NUKE? I’d like to do my own coding so that I have something I understand, and can build on.There really isn't much documentation, because frankly, it is way to open ended. You could put literally *any* firmware on the ArbotiX and interact with it anyway you wanted. If you want to continue using the ROS or PyPose firmware and just write your own wrapper for the PC side, then both the firmware code and the PC-side python code are pretty well documented internally, and porting the Python-based wrapper to your own language shouldn't be too difficult.

-Fergs

RobotAtlas
11-25-2010, 11:49 PM
On the one hand I could get my Arbotix working again which depends on : [Ardinio, Xbee, Python, Pypose, NUKE and now ROS/Linux]. All of which I’m really pretty much a noob.
Alternatively, I can fire up C#, and start writing code to run through a USB2Dynamixel, which seems much more direct, though this will require an onboard PC, which has it’s advantages

Are you planning running Windows in that Fit-PC2 or Mono on Linux?
Doing real-time on Windows might be problematic. Especially if you want your quad to do something else besides walking.
I think my very first post on this forum was something along the lines that microcontrollers are going to die soon and will be replaced by more capable brains such as Fit-PC2. I remember LnxFergy said something about necessity of real-time "coprocessor" (it's actually the word he used and I see now why). I bought FitPC2 in April and I bought AbotiX about 2 weeks ago. Mostly after looking at ArbotiX code.

If you can do C#, you will not be such a stretch to use C on ArbotiX. Python has a different syntax, but also has very nice high-level features.

I would suggest to think about what else your robot will do besides walking. Are you going to do navigation? Autonomity? Are you going to write all that other code yourself from scratch? Or use some Microsoft robotic libraries with C#?

I know some people who tried going MS path and then switched to Linux/ROS (Pi Robot is one example). ROS does have a _lot_ of functionality.

master_of_robots
01-05-2011, 05:18 PM
Ive found that if you put the hardware first, then pick which language you are going to use, that it is much easier, than the other way around.

For example, for my robot I was very adamant about using Java, but after I ran into some very specific issues regarding Java and the hardware I wanted to use, I had to let the hardware dictate the language. Now I'm using C and python.