by Marmakoide » Tue May 19, 2009 12:16 pm
by Marmakoide
Tue May 19, 2009 12:16 pm
Hi,
=== The intented goal ===
I'm trying to understand how to have an accurate control of a AX-12 from a PC with an USB2Dynamixel interface.
I want it to move as following
x(t)=0.5 * pi * sin(t)
where x(t) is the angle in radians and t is the time in seconds
=== My approach ===
I use a very naive approach. I repeat in an infinite loop the following instructions
1) Compute XGoal = x(T+K)
2) Read the current position XCurrent of the AX12
3) Compute V=|Xcurrent - XGoal| / K
4) Write the AX12 register to move to XGoal at speed V
5) K = time elapsed to do step 1) to 4)
When watching XGoal and XCurrent, XCurrent is always a bit late, being behind XGoal. A perfect control would achieve XGoal = XCurrent, up to a given error of course
=== My question ===
How do you, ladies and gentlemen, would do that very simple task ? A less naive approach ? My approach is just broken ?
[/i]
Hi,
=== The intented goal ===
I'm trying to understand how to have an accurate control of a AX-12 from a PC with an USB2Dynamixel interface.
I want it to move as following
x(t)=0.5 * pi * sin(t)
where x(t) is the angle in radians and t is the time in seconds
=== My approach ===
I use a very naive approach. I repeat in an infinite loop the following instructions
1) Compute XGoal = x(T+K)
2) Read the current position XCurrent of the AX12
3) Compute V=|Xcurrent - XGoal| / K
4) Write the AX12 register to move to XGoal at speed V
5) K = time elapsed to do step 1) to 4)
When watching XGoal and XCurrent, XCurrent is always a bit late, being behind XGoal. A perfect control would achieve XGoal = XCurrent, up to a given error of course
=== My question ===
How do you, ladies and gentlemen, would do that very simple task ? A less naive approach ? My approach is just broken ?
[/i]