# Thread: How to change the speed of the AX12a and Read its current speed ?

1. Join Date
Nov 2018
Posts
5
Rep Power
4

## How to change the speed of the AX12a and Read its current speed ?

Hi everyone,

I am new to use dynamixel and ax12a motors. Thus, I have a few questions about ax12a. I will be very happy if you reply to this thread.

I found these pre-defined variables from the dataset of dynamixel for ax12a to use on my code.
AX_PRESENT_SPEED_L 38
AX_PRESENT_SPEED_H 39

AX_GOAL_SPEED_L 32
AX_GOAL_SPEED_H 33

1st Question:
To read the current speed, I need to use this function ax12GetRegister(1,38,2); where 2 presents the byte in read mode, right ? thank you very much.

2nd Question:
To change the speed of the motor, I need to use this function
ax12SetRegister2(1,32,speed_value); where this speed value is between 0 and 255 or with a different value range, right ? thank you very much.﻿

3rd Question:
What is the difference between L and H (L is the Lowest Byte and H is the Highest Byte) while using in the coding and its effects on the ax12a ? thank you very much.

2. ## Re: How to change the speed of the AX12a and Read its current speed ?

The value range is documented in the manual for the servo. I don't remember the exactly values, but because it's a 2-byte register, the value range is higher than 0-255.
The "_L" and "_H" are the two bytes that make up one 16-bit value. The full range of a 16-bit value is 0-65535, but the servo generally uses less of that range.

3. Join Date
Nov 2018
Posts
5
Rep Power
4

## Re: How to change the speed of the AX12a and Read its current speed ?

Originally Posted by jwatte
The value range is documented in the manual for the servo. I don't remember the exactly values, but because it's a 2-byte register, the value range is higher than 0-255.
The "_L" and "_H" are the two bytes that make up one 16-bit value. The full range of a 16-bit value is 0-65535, but the servo generally uses less of that range.
ax12GetRegister(1,38,2);
ax12SetRegister2(1,32,speed_value);

These functions are the correct formats for changing speed and getting the current speed of the motor, right ? thank you.

4. T-1000
Join Date
Feb 2009
Posts
2,288
Images
2
Rep Power
130

## Re: How to change the speed of the AX12a and Read its current speed ?

With generic Robotis Servo questions, unless you are using Trossen Robotics specific hardware/software would suggest asking questions on the Robotis Forum: http://en.robotis.com/service/forum.php

Also suggest looking at e-manual for this servo: http://emanual.robotis.com/docs/en/dxl/ax/ax-12a/

And yes getting the present speed: http://emanual.robotis.com/docs/en/d...esent-speed-38
on ID 38 is the correct one.

And: http://emanual.robotis.com/docs/en/d...oving-speed-32
is the correct one to set the moving speed.

How this value is used may very much depend on what mode the servo is in... Again more details in the emanual

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

#### Posting Permissions

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