Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

AX-12 vs. RX-10 Protocol?

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
23 postsPage 2 of 21, 2
23 postsPage 2 of 21, 2

Post by tafoxx » Thu Jun 25, 2009 2:49 pm

Post by tafoxx
Thu Jun 25, 2009 2:49 pm

Update: The moving speed register can also hold and return a "negative" value. In endless turn mode this determines the direction of turn, but in regular mode the tenth bit is simply ignored.
I guess it's not that surprising. But it means I can just use the same "setSpeed" function for both modes.

Also the max torque value seems to have an effect on speed, for some reason.
And even when at max torque, the moving speed (in RPMs) seems to be exactly half the speed the manual says. That is, when moving speed is 541 (which should be 60 RPMs, according to the manual), each revolution takes about 2 seconds.
Update: The moving speed register can also hold and return a "negative" value. In endless turn mode this determines the direction of turn, but in regular mode the tenth bit is simply ignored.
I guess it's not that surprising. But it means I can just use the same "setSpeed" function for both modes.

Also the max torque value seems to have an effect on speed, for some reason.
And even when at max torque, the moving speed (in RPMs) seems to be exactly half the speed the manual says. That is, when moving speed is 541 (which should be 60 RPMs, according to the manual), each revolution takes about 2 seconds.
tafoxx
Robot Builder
Robot Builder
Posts: 17
Joined: Thu Jun 18, 2009 11:43 am

Post by tafoxx » Thu Jun 25, 2009 4:45 pm

Post by tafoxx
Thu Jun 25, 2009 4:45 pm

Oh... another question. How did you handle nonstandard baud rates? I tried to stick to baud rates which had POSIX-standard macros, but there are only seven which are compatible with the servos! It's a good range from 1M to 9600, though, so I doubt anyone will feel limited by it... but it really does hinder the scan function. If somehow a servo gets set to an incompatible baud rate value, I'd have to use a different program to switch it back!
Oh... another question. How did you handle nonstandard baud rates? I tried to stick to baud rates which had POSIX-standard macros, but there are only seven which are compatible with the servos! It's a good range from 1M to 9600, though, so I doubt anyone will feel limited by it... but it really does hinder the scan function. If somehow a servo gets set to an incompatible baud rate value, I'd have to use a different program to switch it back!
tafoxx
Robot Builder
Robot Builder
Posts: 17
Joined: Thu Jun 18, 2009 11:43 am

Post by RandomMatt » Thu Jun 25, 2009 6:28 pm

Post by RandomMatt
Thu Jun 25, 2009 6:28 pm

tafoxx wrote:How did you handle nonstandard baud rates?


For both windows and unix you can set the baud rate to any integer you want. CBR_57600 (windows) and B57600 (unix) are defined to be 57600.

--

Also... to reset a servos baud rate you only need 57600 - if you are willing use the servo bootloader to clear the eeprom. Personally, I only use 1Mbit.

--

The maximum torque setting effects the maximum torque the motor generates - not the horn. So it isn't a suprise that it effects the speed (some gear train friction will be proportional to speed or even speed squared).
tafoxx wrote:How did you handle nonstandard baud rates?


For both windows and unix you can set the baud rate to any integer you want. CBR_57600 (windows) and B57600 (unix) are defined to be 57600.

--

Also... to reset a servos baud rate you only need 57600 - if you are willing use the servo bootloader to clear the eeprom. Personally, I only use 1Mbit.

--

The maximum torque setting effects the maximum torque the motor generates - not the horn. So it isn't a suprise that it effects the speed (some gear train friction will be proportional to speed or even speed squared).
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by tafoxx » Fri Jun 26, 2009 9:55 am

Post by tafoxx
Fri Jun 26, 2009 9:55 am

Actually, mine is defined differently. I took a peek into bits/termios.h, and here's a snippet of what I found.

#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017

Seems to be relatively arbitrary values. And from what I read here:
http://www.gnu.org/s/libc/manual/html_n ... Speed.html
It seems like the macros are the only portable way to do it.
Actually, mine is defined differently. I took a peek into bits/termios.h, and here's a snippet of what I found.

#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017

Seems to be relatively arbitrary values. And from what I read here:
http://www.gnu.org/s/libc/manual/html_n ... Speed.html
It seems like the macros are the only portable way to do it.
tafoxx
Robot Builder
Robot Builder
Posts: 17
Joined: Thu Jun 18, 2009 11:43 am

Post by tafoxx » Mon Jun 29, 2009 9:02 am

Post by tafoxx
Mon Jun 29, 2009 9:02 am

What was that about torque again? I'm kind of curious about how these things actually work... I'm guessing the torque is controlled by the power supplied to the motor, but what controls the speed? Or is it based on voltage and amperage?
What was that about torque again? I'm kind of curious about how these things actually work... I'm guessing the torque is controlled by the power supplied to the motor, but what controls the speed? Or is it based on voltage and amperage?
tafoxx
Robot Builder
Robot Builder
Posts: 17
Joined: Thu Jun 18, 2009 11:43 am

Post by RandomMatt » Mon Jun 29, 2009 10:14 am

Post by RandomMatt
Mon Jun 29, 2009 10:14 am

tafoxx wrote:Actually, mine is defined differently. I took a peek into bits/termios.h, and here's a snippet of what I found.

#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017

Seems to be relatively arbitrary values. And from what I read here:
http://www.gnu.org/s/libc/manual/html_n ... Speed.html
It seems like the macros are the only portable way to do it.


bits/termios.h... That'd be linux then! in which case you can use B1000000 (for example). The manual page suggests that arbitrary baud rates can be specified using an integer - in which case 1000000 should work as well. (I've tested B1000000 on my laptop but not 1000000).

NetBSD/FreeBSD/OpenBSD/OSX all define the B* macros in termios.h and accept integer baud rates - so 1000000 should work. (They do not have a B1000000 - so that won't work).

In general, you're right, you should use the B* macros to be compatible with the POSIX spec (i.e. portable). But that limits you to speeds of 38400 or less (B57600 isn't defined in the POSIX spec). Basically, with this kind of thing you (and me) are screwed.
tafoxx wrote:Actually, mine is defined differently. I took a peek into bits/termios.h, and here's a snippet of what I found.

#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017

Seems to be relatively arbitrary values. And from what I read here:
http://www.gnu.org/s/libc/manual/html_n ... Speed.html
It seems like the macros are the only portable way to do it.


bits/termios.h... That'd be linux then! in which case you can use B1000000 (for example). The manual page suggests that arbitrary baud rates can be specified using an integer - in which case 1000000 should work as well. (I've tested B1000000 on my laptop but not 1000000).

NetBSD/FreeBSD/OpenBSD/OSX all define the B* macros in termios.h and accept integer baud rates - so 1000000 should work. (They do not have a B1000000 - so that won't work).

In general, you're right, you should use the B* macros to be compatible with the POSIX spec (i.e. portable). But that limits you to speeds of 38400 or less (B57600 isn't defined in the POSIX spec). Basically, with this kind of thing you (and me) are screwed.
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by RandomMatt » Mon Jun 29, 2009 10:22 am

Post by RandomMatt
Mon Jun 29, 2009 10:22 am

tafoxx wrote:What was that about torque again? I'm kind of curious about how these things actually work... I'm guessing the torque is controlled by the power supplied to the motor, but what controls the speed? Or is it based on voltage and amperage?


Inside the AX12 is an AVR Mega8. Two PWM outputs from the AVR are wired to bunch of amplifiers (H-bridges) which drive the motor.

So... the motor is either being driven at full power or no power (depending on the state of the digital PWM output).

The torque limit simply limits the maximum width of a pulse (the duty cycle).

The speed control is achieved by using the position sensor (a pot) and a control loop to generate some desired torque values - these torque values are then capped at the torque limit before being used. In practice we spend most of our time limited by the torque limit, so we'll see that the speed controller simply cannot achieve the speed it wants.
tafoxx wrote:What was that about torque again? I'm kind of curious about how these things actually work... I'm guessing the torque is controlled by the power supplied to the motor, but what controls the speed? Or is it based on voltage and amperage?


Inside the AX12 is an AVR Mega8. Two PWM outputs from the AVR are wired to bunch of amplifiers (H-bridges) which drive the motor.

So... the motor is either being driven at full power or no power (depending on the state of the digital PWM output).

The torque limit simply limits the maximum width of a pulse (the duty cycle).

The speed control is achieved by using the position sensor (a pot) and a control loop to generate some desired torque values - these torque values are then capped at the torque limit before being used. In practice we spend most of our time limited by the torque limit, so we'll see that the speed controller simply cannot achieve the speed it wants.
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by tafoxx » Mon Jun 29, 2009 10:27 am

Post by tafoxx
Mon Jun 29, 2009 10:27 am

Are you saying that torque is equivalent to speed? How's that?
Are you saying that torque is equivalent to speed? How's that?
tafoxx
Robot Builder
Robot Builder
Posts: 17
Joined: Thu Jun 18, 2009 11:43 am

Previous
23 postsPage 2 of 21, 2
23 postsPage 2 of 21, 2