Вы находитесь на странице: 1из 2

AX-12 servo motors with an Arduino Submitted by Martin on Sat,

17/09/2011 - 17:03 In the top of the servo motors, the AX-12 holds
a good place. It is made in Korea by Robotis, sold for $ 45, and
will save you a tremendous amount of time. It is controlled with a
serial bus, type RS-485 with three wires, and an address system.
Here's how to use your AX-12 (and perhaps other Dynamixel
products) simply with an Arduino. Datasheet:
Http://www.bde.enseeiht.fr/clubs/robot/files/AX-12A.pdf Library to
put in a libraries folder in your Sketchbook:
Https://github.com/7Robot/Eurobot2012/blob/master/Arduino/libraries/ax12v2.0.rar (source)
Connection The control is done via a bus in daisy chain, ie each
servo has two identical connectors, to easily connect several
servos in parallel. In the diagram opposite Data transmits the data
in series (TX / RX alternately, cf RS-485). Caution: VDD must be
between 7V and 10V for the servo to light up. We will use the pins
0 (RX) and 1 (TX) of your Arduino, because the pseudo RS-485 of
the servos is not very different from the conventional RS-232.
Simply connect TX or RX to the Data wire in the direction of the
flow. The AX-12 datasheet speaks of the 74HC126 component
but in reality it is enough to alternate the pins of the arduino to
high-impedance (tri-state). This is what the bookseller we will use.
Summary of connection: - GND on the GND of your Arduino VDD on 7V-10V, for example on the Pin of your Arduino, which is
connected to the power connector of the card; And on this
connector you plug a transformer 9V for example. - Data on the
TX and RX pins (1 and 0) of your Arduino, for example by welding
the wire to two pins of a male tulip. Test Programs Here are two
simple programs to test your arduino, and understand the use of
ax12.h: Ax12_aller_retour.pde: The servo makes a round trip
between + 90 and -90 . Ax12_blink_id.pde: Flashes the
LEDs integrated in the AX-12 to display their address. Three
flashes for servo number 3 for example. Useful when several
servos are on the same bus

After installing the library (four files in "Sketchbook / libraries / ax12 /")
here are the main steps to use it:
Create an instance of the class: AX12 engine (id);
In setup (): AX12 :: init (1000000); To adjust the speed of the serial
port.
The AX-12 is seen as a large memory, reflecting position, torque,
servo temperature, etc. To give a position setpoint for example, the
address GOAL_POSITION is written with the instruction:
Motor.writeInfo (GOAL_POSITION, integer); Where integer is a value
between 0 and 1023. The map function can be used to use angles,
paying attention to the physical limits of the AX-12 (60 blind spot), for
example:
Integer = map (angle, -150, 150, 0, 1023);
There is also motor.readInfo (address);
The list of addresses is at the beginning of ax12.h, and their
explanation in the datasheet.
For the rest I let you read the sources of the bookstore, which we regret
that the comments are in Spanish ...

Вам также может понравиться