Show Posts
Pages: [1] 2
1  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: December 29, 2012, 01:50:13 am
90% of the problems I've seen with Dynamixel are due to the power supply. I use a 12V / 4A power supply, which is, in fact, that comes with the Bioloid kit.
2  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: December 28, 2012, 01:14:07 am
The example that comes with the library, is for the Mega or Mega2560. If your board has a single serial port, comment out all lines that have the word "Serial".
3  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: December 26, 2012, 12:17:19 pm
Hi people.

All you have to do to use the MX-28T is to download this:

http://www.pablogindel.com/images/ax12v231.rar

Regards,
P.G.
4  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 09, 2012, 10:46:41 am
I have not really dug into it since its late, but what advantages are you seeing over the normal software serial library (I use soft serial on the 85 quite a bit)

Advantages are:

- light weight
- less CPU usage
- you can use at *any* baudrate (i.e. 3600, 5115, etc.). Particularly suitable for low baudrates, since it not implement delay tables.
- better start and stop bit detections (i think... standard software serial library tends to hang for a long time when it loses sync and data arrives continuously).
- receive only (this may not be an advantage).
5  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 08, 2012, 12:13:35 am
Here is my software serial library for Arduino Tiny: http://www.pablogindel.com/images/SoftSerial.rar

Instructions in usage.txt file.

Regards,
P.G.
6  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 07, 2012, 12:17:18 am
Thank you very much, all of you.

I love Arduino Tiny, very complete implementation.

By the way, I made a timer-driven Software Serial library for Attiny85, without delay tables. It does not consume CPU time, and can work at any baudrate, even a non-standard. Want to see it?
7  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 05, 2012, 11:46:30 pm
This is great, thanks.

I can ask you another question? What are enabled PWM pins in the Attiny85? According to the datasheet, pin3 = OC1B, pin5 = OC0A and pin6 = OC0B/OC1A. Does that mean that I should use D0, D1 and D4 in Arduino pin naming scheme?
8  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 05, 2012, 11:16:02 am
I want to make a question:

It is possible with this core (arduino-tiny-0100-0015) to use 3 PWM in attiny85 with analogWrite()?
9  Community / Exhibition / Gallery / Re: AX12 Hexapod Robot and other projects. on: March 23, 2011, 06:01:52 am
Hi smiley

I updated my website, and posted the documentation of my project along with its sources:

http://www.pablogindel.com/trabajos/samsa-ii-2010/

Regards,
Pabloxid.
10  Community / Exhibition / Gallery / Re: AX12 Hexapod Robot and other projects. on: March 12, 2011, 04:17:33 pm
Thanks, david.

I do as a hobby... but if you offer me any job I accept it smiley-wink
11  Community / Exhibition / Gallery / Re: AX12 Hexapod Robot and other projects. on: March 11, 2011, 01:30:18 pm
1 year ago I developed the voice recognition, but I think had I not shown here in this forum.

Yes, the AX-12 cost $ 45 each.
12  Community / Exhibition / Gallery / Re: AX12 Hexapod Robot and other projects. on: March 10, 2011, 01:44:13 pm
Hi Federico, thank you very much for your comment.

Yes, of course, I can paste the code here. By the way: you speak Spanish? Because the code comments are all in Spanish, and I speak very bad English.

First, there are some definitions and pre-computed constants to speed up calculations.
Code:
// tipos
typedef struct {float x; float z;} COORD2D;
typedef struct {float x; float y; float z;} COORD3D;
typedef struct {COORD3D patas[6];} POSICION;
typedef struct {int gama; int alfa; int beta;} ANGULOS;

// propiedades del robot
#define BAUDRATE   1000000                // velocidad de comunicación de los AX12
#define DIST       5.0                    // distancia entre el eje del primer motor y el segundo (en cm)
#define MUSLO      8.2                    // longitud del "muslo" (en cm)
#define TIBIA      11.7                   // longitud de la "tibia" (en cm)
#define SEPARA     8.75                   // separación entre las inserciones de las patas (en cm)
#define ORIGEN     9.6                    // distancia entre el origen de la x y el centro del tronco (en cm)
#define ANG_SCALE  614                    // unidades angulares, equivalente a PI o 180º
#define ANG_ZERO   518                    // offset angular (teóricamente tendría que ser 512, pero ya ves...)
#define TICK       .004                   // duración del tick en segundos
#define VEL_MAX    684                    /* velocidad máxima de la escala en grados/segundo. (Nota: 119rpm según la info actualizada de Dynamixel, lo que equivale a 684º/s. No obstante, el motor no pasa de los 300º/s, por lo que adquiere su velocidad máxima por la mitad de la escala. */

// constantes para acelerar el cálculo
float const doublea = 2 * MUSLO;
float const doubleab = 2 * MUSLO * TIBIA;
float const sqaplussqb = sq (MUSLO) + sq (TIBIA);
float const sqaminussqb = sq (MUSLO) - sq (TIBIA);
float const vel_scale = 184200.0 / (TICK*VEL_MAX*ANG_SCALE);         /* velocidad(AX12) = unidades_angulares*vel_scale/ticks */
byte const overflow = 256 - (TICK*14000);                        // valor inicial del contador para el timer2

Then there is a pair of routines, one that converts Cartesian coordinates to angles, and the other does the reverse:
Code:
ANGULOS alfabetagama (COORD3D P) {     
  // convierte las coordenadas cartesianas en los ángulos correspondientes
  // recibe: xn, y, z; devuelve giro (gama), cadera (alfa), rodilla (beta) 
  // fundamento: teorema de pitágoras + teorema del coseno (ver figura)
 
  P.x = abs (P.x);        // pequeño truco para abarajar la simetría del eje x
  ANGULOS A;
 
  // fase 1, calculamos "x" y el ángulo "gama"
  // DIST es la distancia entre el eje del primer motor y el segundo
  float x = hypot (P.z, P.x+DIST) - DIST;   // P.x = xn                           
  A.gama = ANG_SCALE*(atan(P.z/(P.x+DIST)))/PI;                   
 
  // fase 2, calculamos alfa y beta
  // ver constantes definidas al principio
  float sqx = sq(x); float sqy = sq(P.y);
  float cosalfa = (sqx + sqy + sqaminussqb) / (doublea*sqrt(sqx + sqy));          // coseno del angulo que forman el "muslo" y la hipotenusa
  float cosbeta = (sqaplussqb - sqx - sqy) / doubleab;                         // coseno del angulo que forman "muslo" y "tibia"
  A.alfa = ANG_SCALE*(acos(cosalfa) + atan(P.y/x))/PI;
  A.beta = ANG_SCALE/2 - ANG_SCALE*acos(cosbeta)/PI;
 
  return A; 
}

COORD3D xyz (int angulos[]) {                   // "cinemática directa"
  float rad [3];
  for (byte i=0; i<3; i++) {
    rad[i] = PI * angulos[i] / ANG_SCALE;        // convierte a radianes
  }
  // rad[0] = gama; rad[1] = alfa; rad[2] = beta
  float sqc = sqaplussqb - (doubleab * cos(rad[2]-PI/2));
  float c = sqrt(sqc);
  float cosalfa = (sqc + sqaminussqb) / (doublea*c);
  float delta = rad[1] - acos(cosalfa);
  float x = c * cos(delta);
  return (COORD3D) {(x+DIST)*cos(rad[0]) - DIST, c*sin(delta), (x+DIST)*sin(rad[0])};
}
13  Community / Exhibition / Gallery / AX12 Hexapod Robot and other projects. on: March 09, 2011, 01:53:12 pm
Hi friends, I want to show some Arduino-based projects I did.

An Arduino Mega controlled hexapod robot, with 18 Dynamixel AX-12 motors:




This uses the Arduino Dynamixel library:




Some Arduino DMX lighting:




And finally, an Artificial Neural Network based voice recognition system, running completely in the Wiring board (that is almost identical to Arduino), without the aid of an external PC:




Thanks for your attention, greetings to everyone.
14  Forum 2005-2010 (read only) / Troubleshooting / Re: Problem with Receiving data at 1MBps ( 1000000bps) on: January 07, 2011, 12:48:40 pm
Thanks Andy!

This is very interesting, and I come 2 new questions:

1) What happens when a byte arrives through the serial port, and CPU is taking timer0 interruption? That byte is lost? In this case, it is still true what Mike suggests...

2) I understand that, then, you may receive serial data even when you are inside an ISR, just enabling certain bit from there, am I right?
15  Forum 2005-2010 (read only) / Troubleshooting / Re: Problem with Receiving data at 1MBps ( 1000000bps) on: January 06, 2011, 10:03:31 pm
Hi,

Here is a very popular library to handle Dynamixel motors, capable of receiving data at 1Mb/s.

It is based on Arbotix software, which uses its own serial ISR and not the one included in HardwareSerial.cpp

http://www.pablogindel.com/2010/01/biblioteca-de-arduino-para-ax-12/

My question is whether, as Mike says, disabling timer0 interrupt effectively affects serial reception; I think it don't, because while the CPU is handling an interrupt it blocks any other interrupt, am I right?

Pablo.
Pages: [1] 2