Mostrando entradas con la etiqueta Programming Robotis Bioloid hardware. Mostrar todas las entradas
Mostrando entradas con la etiqueta Programming Robotis Bioloid hardware. Mostrar todas las entradas

lunes, 9 de abril de 2012

Learning scurves with AX-12

I'm learning how to use scurves with AX-12, so I've created a test CM-510 C program where I try different approachs. Any help will be very well received, because my goal is to control several AX-12 and I'm far far away from it!

Here is the program with an spreadsheet with the calculations (LibreOffice and Excel). I have started from an old post from Bullit in the Tribotix forum (now in PDF format at Robosavvy)

Clockwise is the standard motion, counter clockwise is the scurve intended motion

[youtube http://www.youtube.com/watch?v=YBdO0232QvQ]

martes, 7 de febrero de 2012

Choose hardware, firmware and language

There are a lot of possible combinations of hardware, firmware and languages for programming Bioloid. I think that the table below show the the main combinations.

You can choose from the easy but limited Robotis own tool (Roboplus Task) and only your CM-5 or CM-510 to a SBC or "embedded" PC like Roboard and any language which can manage a serial port connection, like C, C++, Java, Python,...

Linux C++ Dynamixel reading and writing example

C# Dynamixel reading and writing example

Practical C++ programming tutorial for Bioloid

[caption id="attachment_256" align="aligncenter" width="617"]Programming Bioloid: choose hardware, firmware and languages Programming Bioloid: choose hardware, firmware and languages[/caption]

Robotis officially supports the programming solutions with the blue background:

  • The dark blue, RoboPlus Tasks, is the only one in which you can create the motions with RoboPlus Motion and execute it in CM-5/CM-510 with the program create with RoboPlus Tasks, after downloading the generated executable into the CM-5/CM-510, of course.



With these programming solutions you can use the Zigbee SDK to send and receive data between the CM5-/CM-510 and any computer, using Zig-110A or the new bluetooth BT-110, the Zig2Serial and the USB2Dynamixel. You can download example in Visual Basic .Net, C# and Visual C++

But there are more options!

Using a PC, SBC (Single Board Computer), PDA, Mobile or other light and battery powered computer

Using a serial port connection with your more beloved programming language:

  • USB2Dynamixel


If you have any device with a USB host and a FTDI driver you can use USB2Dynamixel to command programatically your Dynamixel servos using the Dynamixel protocol. You only will need your CM-5 or CM-510 to connect your Dynamixel to the battery.

  • Serial port cable


Same as the previous option but instead of using the USB2Dynamixel you only will need the serial cable and the "Toss Mode" launched with the 't' command from the "Manage Mode"


  • Wireless control


Instead of only sending and receiving data, with the previous wireless connections you can command remotely your robot using the standard firmware and the "Toss Mode" launched with the 't' command from the "Manage Mode". You will need to command it using the Dynamixel protocol.

With these options and the CM-510 you will find a little problem... there is no way to read your sensor values! Well, you can use this firmware that offers a "Toss Mode" that supports reading CM-510 ports.

Start learning!

If you want to start learning how to program your CM-5 or CM-510 controller you will find interesting this post "Start programming  CM-5/CM-510 in C". But may be you prefer to control your robot from a PC, SBC or other computer in C++ or C#

martes, 22 de noviembre de 2011

CM-510 as a multiple sensor dynamixel item (updated 7/11/13)

[UPDATE 7/11/13: CM_510 TossModeJCA updated to v5.8. Several parameters error fix and somewhat faster]

My main Bioloid project is to build a robot that will have some interesting (non easily predictable but reasonable) behaviours. AntOne 3.6 is the last version:

AntOne 3.6 is based on a PDA that has the software for the behaviour and a CM-510 (ATMega 2561) that control the hardware (servos and sensors). But I discovered that standard CM-510 firmware has no command to get sensor values, so I programmed another with that function. But then I thought that it would be interesting to embed some perception functions in the CM-510.

This is a general diagrama:

[caption id="attachment_47" align="alignnone" width="547"]Single controller Single controller[/caption]

Updated 23/2/2013

The new hex file v4.3 (the old CM-510 firmware)

Now it supports new functions, as:

- Toss Mode (up) now can read from Dynamixel and write to serial and, as the previous version, read from serial and write to Dynamixel, it allows to....
- receive from zigbee and send the data to the Dynamixel button
- read raw sensor values
- averaged sensor values when F_SET_SENSOR_VALUES_TO_FILTER is set < 5, not including the min and the max when >= 5
- CM-510 beep
- sensor scan (still in development)

[sourcecode language="c"]
#define F_NO_FUNCTION 0
#define F_GET_SENSOR_VALUE_RAW 1
#define F_GET_TWO_DMS_SENSOR_VALUES 2
#define F_GET_MULTIPLE_SENSOR_VALUE 3
#define F_GET_SENSOR_VALUE_FILTERED 4
#define F_SET_SENSOR_VALUES_TO_FILTER 5

#define F_BEEP 8
#define F_DO_SENSOR_SCAN 9
#define F_SET_VALUE_DMS1 11
#define F_SET_VALUE_DMS2 12
[/sourcecode]

C# example os use:

[sourcecode language="csharp"]
private void B_ReadPort_Click(object sender, EventArgs e)
{
byte function = (byte)NUD_Function.Value;
byte portId = (byte)NUD_Port.Value;

if (portId < 0 || portId > 6)
portId = 1;

string strPortId=portId.ToString();

if (function == 1 || function == 4)
{
short portValue = cm510.getSensorValue(function, portId);
string str = portValue.ToString();

TB_PortValue.Text = str;
}
else
{
if (function == 2)
{
byte[] parameters = new byte[3];
parameters[0] = function;
parameters[1] = Convert.ToByte(TB_DMS1_ID.Text);
parameters[2] = Convert.ToByte(TB_DMS2_ID.Text);

short[] values = new short[3];
cm510.getMultipleSensorValue(parameters, values);
//cm510.getTwoSensorValue(function, Convert.ToByte(TB_DMS1_ID.Text), Convert.ToByte(TB_DMS2_ID.Text), values);

if (values.Length >= 2)
{
TB_DMS1_PortValue.Text = values[1].ToString();
TB_DMS2_PortValue.Text = values[2].ToString();
}
}
else
{
if (function == 3)
{
byte[] parameters = new byte[3];
parameters[0] = function;
parameters[1] = Convert.ToByte(TB_DMS1_ID.Text);
parameters[2] = Convert.ToByte(TB_DMS2_ID.Text);

short[] values = new short[3];
cm510.getMultipleSensorValue(parameters, values);

if (values.Length >= 2)
{
TB_DMS1_PortValue.Text = values[1].ToString();
TB_DMS2_PortValue.Text = values[2].ToString();
}
}
else
{
if (function == 11)
{
TB_DMS1_ID.Text = strPortId;
}
else
{
if (function == 12)
{
TB_DMS2_ID.Text = strPortId;
}
}
}
}
}
}

[/sourcecode]