Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: April 02, 2014, 06:37:30 am
I'm back made ​​a mess. I thought that just that to the code lauszus ...
2  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: March 31, 2014, 09:54:18 am
but lauszus code does that way, no?

Code:
  kalAngleX = kalmanX.getAngle(accXangle, gyroXrate, (double)(micros() - timer) / 1000000); // Calculate the angle using a Kalman filter
  kalAngleY = kalmanY.getAngle(accYangle, gyroYrate, (double)(micros() - timer) / 1000000);

kalAngleX & kalAngleY should be correct angles of the plane at all times, right?

3  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: March 17, 2014, 01:46:25 pm
Tks lauszus,

I tried, but I got no good result. Also try the complementary filter (even values ​​ranging from 0.98 to 0.02 and 0.02 to 0.98 in a formula). The result is always the same. Works fine on the ground, if the imu is static, but when starts to fly, the imu does not mark well.

I have purchased a mpu 6050to see if I had better results with the updated code and the first test with the kalman has not gone well. I think I have a lot of vibration. I'll try to isolate the 6050 and I'll try again.

its correct this code to change the gyro and acc range to 2000 deg/s and +-8g ?

Code:
i2cData[0] = 7; // Set the sample rate to 1000Hz - 8kHz/(7+1) = 1000Hz
  i2cData[1] = 0x00; // Disable FSYNC and set 260 Hz Acc filtering, 256 Hz Gyro filtering, 8 KHz sampling
  i2cData[2] = 0x03; // Set Gyro Full Scale Range to ±2000deg/s
  i2cData[3] = 0x02; // Set Accelerometer Full Scale Range to ±8g
4  International / Español / COndensador de arduino pro mini on: March 11, 2014, 07:23:12 am
Ayer al conectar alimentacion a una placa mini pro, inverti la polaridad, y salto un condensador. Es el que se ve chamuscado en la foto. POdeis decirme los valores que tiene para reemplazarlo?
5  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: March 06, 2014, 11:20:29 am
HI Lauszus,

I finally finished reading the 34 pages of this post! VEry valuable information, but I have not managed to find anyone with the same problems that me.

I have written some doubts in your  Kalman filter article comments . I've thought about moving them to this thread so that if someone encounters the same problem, here you can find the information to solve it (if I can ever fix it ... ) smiley

First of all, I use your code LPR530AL_LY530ALH_ADXL335. I only modified the data sensitivity to suit my gyroscopes, which are the IDG650 and ISZ650. Here are their datasheets: http://www.roboard.com/Files/G145/Datasheet_IDG650.pdf and http://www.roboard.com/Files/G145/Datasheet_ISZ650.pdf . Instead of the sensitivity data your code, I used 2.27, which I think are the sensitivity data of my gyros ... ((0.00227*1023)/3.3 = 0.7037)

This is your code:
Code:
void loop() {
  double gyroXrate = -((analogRead(gX) - zeroValue[0]) / 1.0323); // (gyroXadc-gryoZeroX)/Sensitivity - in quids - Sensitivity = 0.00333/3.3*1023=1.0323
  gyroXangle += gyroXrate * ((double)(micros() - timer) / 1000000); // Without any filter

  double gyroYrate = -((analogRead(gY) - zeroValue[1]) / 1.0323);
  gyroYangle += gyroYrate * ((double)(micros() - timer) / 1000000);

This is mine:
Code:
void loop() {
  double gyroXrate = -((analogRead(gX) - zeroValue[0]) /0.7037); // (gyroXadc-gryoZeroX)/Sensitivity - in quids - Sensitivity = (0.00227*1023)/3.3 = 0.7037
  gyroXangle += gyroXrate * ((double)(micros() - timer) / 1000000); // Without any filter

  double gyroYrate = -((analogRead(gY) - zeroValue[1]) /0.7037);
  gyroYangle += gyroYrate * ((double)(micros() - timer) / 1000000);

Is correct?

Everything works correctly when the  imu is static. IF I move the imu, I get the correct values in xAngle and yAngle variables. The problem occurs when the imu is in the airplane for which I am doing the tests. When the airplane takes off and starts flying, readings are totally erroneous.

IN the comments, you say me that :

Quote
It is most likely happening because your accelerometer values gets screwed up since I tuned the Kalman filter for my balancing robot and not for something like an airplane which is exposed to much larger g-forces than a balancing robot.

I went back to read the section “The measurement" one more time, and I understood there that  is need to adjust the values ​​of variance. it Refers to Q_angle, Q_bias and R_measure variables? But, these variables do not affect what you told me to tune the data to adjust the filter for the small g forces that supports your robot or the bigs one that is supporting my airplane… or affects?

I'm not sure these are the values ​​I need to change to adjust the kalman filter to the strongest forces g the imu has to endure in the plane.

And, in the comments, you say:

Quote
Yes they do. For instance try to increase R_measure and it should trust new measurements less.

I have only tried with the values ​​of kalman filter. i´ll try to modify the R_measure.  Now, I'll try with the values ​​of the complementary filter, to see if the same error occurs also.

Any help will be most welcome.
6  International / Español / Re: Voltaje variable con analogWrite on: February 02, 2014, 02:10:27 pm
HOmbre, el vistazo la se lo he echado... Puedes ser mas concreto?

Si lo dices por que no he declarado el pin como salida en otros textos de referencia dice que no es necesario, y de hecho lo he probado de ambas formas con identico resultado...

En un arduino mega que tengo funciona perfectamente...

Aun a riesgo de salirme de mi territorio e internarme en el desconocido de la electrónica, aunque el comando se llame analogwrite, la salida que da es de 5v en impulsos de mayor o menor anchura dentro del ciclo. Así que es correcto que detectes 0 o 5v. Podríamos decir que lo que se regula es la intensidad media por ciclo. Seguramente que haya algún circuito que pueda convertir en voltaje esos impulsos, pero ahí tendrá que asesorarteb siguen que sepa smiley-roll-blue.

El segundo parametro define el ancho de pulso, con lo que se consigue el voltaje determinado...
7  International / Español / Re: Voltaje variable con analogWrite on: February 02, 2014, 07:26:48 am
Perdon, aqui esta:

Code:
int Pin = 11;   
void setup()  {
  // nothing happens in setup
}

void loop()  {

    analogWrite(Pin, 50);      // 0 voltios en el multimetro.   
    delay(5000);
    analogWrite(Pin, 150);     //5 voltios en el multimetro.   
    delay(5000);     
 
}

 
8  International / Español / Voltaje variable con analogWrite on: February 01, 2014, 04:24:10 pm
Hola a todos.

Estoy intentando conseguir "emular" un voltaje por medio de la instruccion analogWrite, como leo en

http://forum.arduino.cc/index.php?topic=31710.0
o
http://www.arduteka.com/2011/11/tutorial-arduino-0003-entrada-analogica-y-salida-pwm/
o
http://arduino.cc/es/Reference/AnalogWrite

pero no consigo hacer que me funcione.

Conecto un multimetro a la salida 11 de un ATmega328, y pasa de 0 voltios si el parametro de analogWrite es de 125 para abajo y 5 voltios si esta de 125 para arriba... NO consigo voltajes intermedios...

ej:  analogWrite (11, 120); //EL voltaje es 0v
      analogWrite (11, 80); //EL voltaje es 0v
      analogWrite (11, 150); //EL voltaje es 5v
      analogWrite (11,200); //EL voltaje es 5v

POdeis decirme que hago mal??

Gracias por vuetro tiempo.
9  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 04:27:30 pm
ok, probare eso cuando vuelva, alimentar de una fuente distinta servos y lcd, a ver que pasa.

Por que en principio no debe ser por temas de pines incompatibles con servos, verdad?
10  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 03:48:06 pm
La lipo es 3s, de 12v.

El ubec es un regulador de voltage con filtros anti ruido. El que uso es este: http://www.hobbyking.com/hobbyking/store/__4319__TURNIGY_3A_UBEC_w_Noise_Reduction.html

Estoy fuera de casa, el domingo cuando llegue hago y cuelgo un esquema, pero vamos, hay poco error posible. Negativo de salida del regulador a los negativos de servos y lcd. POsitivos a positivos de servos y lcd. Conexion directa de la lipo 12v al arduino.
11  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 05:49:41 am
lo alimento con la lipo, igual que el arduino.
12  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 03:53:49 am
Son correctas las dos cosas. La salida del ubec para alimentar servos y lcd es de 5v y soporta 5 amperios. Pero el arduino no esta conectado al ubec, esta conectado directamente a la lipo de 1000 mah.
13  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 02:30:39 am
Alimento el arduino y el ubec con una lipo de 1000 mah. El arduino mediante el conector de alimentacion. El ubec es de 5 A. El positivo y la masa de los servos van a la salida del ubec. La señal de cada uno de los servos a las patillas 8 y 9. Las patillas 1 y 2 y las 15 y 16 tambien van directamente al ubec.

Os pongo la foto pero me parece que va a ser poco aclaratoria.

En principio deberia funcionar?
14  International / Español / Re: Incompatibilidad servos y LCD? on: April 12, 2013, 01:49:10 am
codigo:

Code:
// include the library code:
#include <SPI.h>         // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <LiquidCrystal.h>
#include <Servo.h>

Servo myservo;
Servo myservo2;
int pos = 0;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 177);

unsigned int localPort = 9500;      // local port to listen on

// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char  ReplyBuffer[] = "acknowledged";       // a string to send back

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup() {
 
  Ethernet.begin(mac,ip);
  Udp.begin(localPort);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
 
    myservo.attach(9);
    myservo2.attach(8);
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
 
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);
    myservo2.write(pos);    // tell servo to go to position in variable 'pos'
    delay (15);                      // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);
    myservo2.write(pos);    // tell servo to go to position in variable 'pos'
    delay (15);                     // waits 15ms for the servo to reach the position
  }

  int packetSize = Udp.parsePacket();
  if(packetSize)
  {
    Serial.println(packetBuffer);
  }



}
15  International / Español / Re: Pequeño error al sumar floats entre si (o al pasar de string a float ) ¿por que? on: April 11, 2013, 08:57:56 am
necesito esa precision. Es una coordenada geografica. SI le quito cifras la dejo coja... Le echare un ojo al post y probare con double. smiley

Gracias.
Pages: [1] 2 3 ... 6