Show Posts
Pages: [1] 2 3
1  Using Arduino / Microcontrollers / Re: Programming a Baby Orangutan using Arduino Uno ? on: December 07, 2012, 09:28:21 am
The PC uses the serial lines to communicate with the Arduino. You can't leave them connected to your orangutan while uploading a sketch.

You could use SoftSerial to connect the orangutan to other pins.


That's the idea, I'm trying to upload a sketch directrly to the Orangutan using the Arduino Programmer.
That's why i took the Arduino chip out.
2  Using Arduino / Microcontrollers / Programming a Baby Orangutan using Arduino Uno ? on: December 07, 2012, 08:57:27 am
Hey,

I have the following setup:
Arduino UNO without the chip:

Notice that the Atmel chip is missing.

And i have a Baby Orangutan:


The orangutan burned with Arduino Uno R3 Bootloader.

I connected Orangutans PD0 (RX) and PD1 (TX) to the Uno's D0 (RX) and D1(TX) so that i can program the orangutan using Arduino AVR programmer.

When I'm connecting my Uno to the PC using a USB Cable, it's being recognized as a Uno R3 even when the chip is off, becuase the Orangutan has a Uno bootloader.

Now the problem is when I'm trying to upload a sketch it sais:

avrdude: stk500_getsync(): not in sync: resp=0x00
3  Using Arduino / Motors, Mechanics, and Power / Re: SparkFun Easy Driver stepper motor gone crazy ! on: December 04, 2012, 04:09:52 pm
Has the power supply changed? Have you tried adjusting the current regulator potentiometer on the Easy Driver board?

Nothing changed in the power supply.. and i tried adjustingthe potentiometer...
Nothing seems to work..

The only thing that changed is a new Mega 2560 and also tried with a new Uno..
I also got a new 10 meter USB cable.
4  Using Arduino / Motors, Mechanics, and Power / SparkFun Easy Driver stepper motor gone crazy ! on: December 04, 2012, 03:52:49 pm
Hey,

I'm using https://www.sparkfun.com/products/10267 SparkFun EasyDriver with the following code:

Code:
void setup()
{
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(12, OUTPUT);
    
  Serial.begin(9600);
  Serial.println("start");
}

void loop()
{
  stepper(9 ,10, 1000, HIGH);
  stepper(7 ,8, 1000, HIGH);
  stepper(6 ,12, 1000, HIGH);
}

void stepper(int StepPin, int DirPin, int Steps, int Direction)
{
    Serial.print("In stepper ");
    Serial.println(StepPin);
    int i;
    digitalWrite(DirPin, Direction);
    for (i=0; i < Steps; i++)
    {
        digitalWrite(StepPin, HIGH);
        delayMicroseconds(1000);
        digitalWrite(StepPin, LOW);
        delayMicroseconds(1000);
    }
}

It used to work good but suddenly without making any changes
The motors just shaking, i mean it looks like it goes 1 step forward then 1 backward very fast...
I tried changing delay, pins, direction but nothing changes it...

The motor just going crazy...

Any ideas?
5  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 19, 2011, 11:39:03 am
Okay smiley It is actually possible to get a servo that can rotate 360 degrees. I found this after some googling: http://www.pololu.com/catalog/product/522 , that might do the job.

The IMU I used can only get 360 degrees resolution, if you only use either pitch or roll, but it can not be used at the same time...
But if you only need one of them, the IMU will work just fine smiley-grin

Regards Lauszus

Hey, Thanks !

I actually need a really strong Servo, i need something like 70kg/cm smiley
I found this http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=18742 and i will add him another gear to make it 100gk/cm smiley

If i get the IMU that you use in your example and use the Kalman Filtering, will i get 100% accuracy on 360 rotation ?

Thanks,
Dan
6  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 18, 2011, 03:48:36 am
Why not just use a ordinary Servo then?
Thank you for the kinds words smiley

Regards
Lauszus

Hey Lauszuz,

Sorry for the long time till i replay i was away.

An ordinary Servo wont give me the Power i need, and i need 360 degrees and not 180, and i have size capabilities.

I think i will get the IMU that you use, will it give me 100% accuuracy ?
7  Using Arduino / Sensors / Re: Gyro Angle calculations isn't precise ? on: November 09, 2011, 08:44:32 am
After doing all of this, my gyro is still like 95% accurate ...
i need 99% atleast..

I just think i'm gonna get an Absolut Angle sensor and connect it to the servo..

Thanks for the help smiley
8  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 09, 2011, 08:44:11 am
Hey smiley

I have a continues Servo... and after doing all of this, my gyro is still like 95% accurate ...
i need 99% atleast..

I just think i'm gonna get an Absolut Angle sensor and connect it to the servo..

Thanks for the help anyway, you were very nice and helpfull smiley
9  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 08, 2011, 11:22:28 am
Hey, i still didn't solve it smiley-razz

I'll explain why the setup for and what is my problem.
As you see i have a WiFi shield connected, i send him commands to spin the servo that is connected to a arm that the gyro is on so the gyro spins with it.

I want to tell the servo to spin 90 degrees, and then go back to 0 degrees, and do that in a loop.
That's why i need the Gyro for, to get the degrees.

My problem is that after 2-3 time it goes to 90 then 0 the drifting goes crazy and it goes to 110 then -20...
So my problam still isn't solved.

I posted all my setup so you can see if i'm doing everything right, i hope you can help me figure it out.
10  Using Arduino / Sensors / Re: Gyro Angle calculations isn't precise ? on: November 08, 2011, 06:22:02 am
Hey, thanks alot for you replays i learn alot of new stuff and you are being very helpfull smiley

So in my Gyro i have VCC & GND pin, i connected the VCC to the Arduino 3.3v pin and the GND to one of the GND pins on the Arduino.
And i connected the OUT pin of the gyro to the Analog0 pin on the Arduino.

I use this external Power Supply


As you can see i'm giving 12v to the Arduino, and the Fixed volts are set to 3.3v and connected stright to the AREF pin and one of the GND pins on the arduino.

Now i changed my sensitivity back to 1.023, and added
Code:
analogReference(EXTERNAL);
to the
Code:
setup()
in my code.



You can see the purple black and red goes to the gyro, the big connector that connected to the 7,8,9 digitals is a Servo controller, and the  2 pins from the external supply to the AREF & GND.

Here is the code, every one milliseconds i call this:
Code:
void gyroTest()
{
    if(gyroInit) {
      finalGyroAngle = calculateGyroAngle(0);
      Serial.println(finalGyroAngle);
    }
}

Code:
float calculateGyroAngle(int pin)
{
    gyroAdc = calibrateGyro(0);
    if(abs(gyroAdc - gyroZero) <= Threshold)
      gyroAdc = gyroZero;
    gyroRate = (gyroAdc-gyroZero)/sensitivity;
    gyroRotation+=gyroRate*dtime/1000;
    unsigned long t = millis();
    dtime = t - stime;
    stime = t;
    return gyroRotation;
}

void InitGyro(int pin)
{
  Serial.println("Calibrating Gyro...");
  sensitivity = 1.023; //0.692454545; //0.716454545;
  gyroAdc = 0;
  gyroRate = 0;
  gyroRotation = 0;
  gyroAngle = 0;
  gyroZero = calibrateGyro(pin);
  Serial.print("Gyro Calibrated: ");
  Serial.println(gyroZero);
}

int calibrateGyro(int pin)
{
  long resultGyro = 0;
  for(int i=0;i<100;i++)
  {
    resultGyro += analogRead(pin);
    delay(0.5);
  }
  resultGyro = resultGyro/100;
  return resultGyro;
}

Am i doing everything ok ?
11  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 08, 2011, 05:42:16 am
Hey, thanks alot for you replays i learn alot of new stuff and you are being very helpfull smiley

So in my Gyro i have VCC & GND pin, i connected the VCC to the Arduino 3.3v pin and the GND to one of the GND pins on the Arduino.
And i connected the OUT pin of the gyro to the Analog0 pin on the Arduino.

I use this external Power Supply


As you can see i'm giving 12v to the Arduino, and the Fixed volts are set to 3.3v and connected stright to the AREF pin and one of the GND pins on the arduino.

Now i changed my sensitivity back to 1.023, and added
Code:
analogReference(EXTERNAL);
to the
Code:
setup()
in my code.



You can see the purple black and red goes to the gyro, the big connector that connected to the 7,8,9 digitals is a Servo controller, and the  2 pins from the external supply to the AREF & GND.

Here is the code, every one milliseconds i call this:
Code:
void gyroTest()
{
    if(gyroInit) {
      finalGyroAngle = calculateGyroAngle(0);
      Serial.println(finalGyroAngle);
    }
}

Code:
float calculateGyroAngle(int pin)
{
    gyroAdc = calibrateGyro(0);
    if(abs(gyroAdc - gyroZero) <= Threshold)
      gyroAdc = gyroZero;
    gyroRate = (gyroAdc-gyroZero)/sensitivity;
    gyroRotation+=gyroRate*dtime/1000;
    unsigned long t = millis();
    dtime = t - stime;
    stime = t;
    return gyroRotation;
}

void InitGyro(int pin)
{
  Serial.println("Calibrating Gyro...");
  sensitivity = 1.023; //0.692454545; //0.716454545;
  gyroAdc = 0;
  gyroRate = 0;
  gyroRotation = 0;
  gyroAngle = 0;
  gyroZero = calibrateGyro(pin);
  Serial.print("Gyro Calibrated: ");
  Serial.println(gyroZero);
}

int calibrateGyro(int pin)
{
  long resultGyro = 0;
  for(int i=0;i<100;i++)
  {
    resultGyro += analogRead(pin);
    delay(0.5);
  }
  resultGyro = resultGyro/100;
  return resultGyro;
}

Am i doing everything ok ?
12  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 07, 2011, 02:43:17 am
Have you remembered to connect 3.3 Volt to the VREF pin on the Arduino? smiley

Regards
Lauszus

I used this guide: http://wiring.org.co/learning/basics/gyrolisy300al.html
I connected the VCC on the gyro to the Arduino 3.3v pin.

Is that what you ment ?
13  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: November 06, 2011, 11:30:16 am
First of all, how did you calculate your sensitivity?
If you use either 3.3 or 5 volt as reference, it's either:
0.0033/3.3*1023=1.023
or
0.0033/5*1023=0.67518
As the sensor has a sensitivity of 3.3 mV/ °/s
Or do you use a different reference? As i can calculate you use 4.711952801 volt as reference (0.0033/4.711952801*1023=0.716454545).

Why do you need this line:
Code:
gyroAngle = abs((gyroRotation - 360 * ceil(gyroRotation / 360))); // Round up between 0-360

What you call "gyroRotation", is actually the angle smiley

For more precision use integration.
Something like this would work:

Code:
#define OFFSET 0.0005

gyroRaw = analogRead(0);
gOffset = OFFSET * gyroRaw + (1-OFFSET) * gOffset;
gyroSpeed = (gyroRaw - gOffset)/sensitivity;

gyroAngle += gyroSpeed*dtime/1000;

See this page for more information: http://www.hitechnic.com/blog/gyro-sensor/htway/

Regards
Lauszus


Hey, thanks for the replay.

I'm using 3.3v so i changed the sensitivity to 1.023, now the numbers are even less precise.
the gyroZero after calibration is around 325, and the gyro goes about -+300.

I removed the
Code:
gyroAngle = abs((gyroRotation - 360 * ceil(gyroRotation / 360))); // Round up between 0-360

When i use this:
Code:
#define OFFSET 0.0005

gyroRaw = analogRead(0);
gOffset = OFFSET * gyroRaw + (1-OFFSET) * gOffset;
gyroSpeed = (gyroRaw - gOffset)/sensitivity;

gyroAngle += gyroSpeed*dtime/1000;

The numbers goes crazy and keep going up even when the gyro doesn't move.

Bottom line:
Sensitivity = 1.023 - When i move my object 90 Degrees, the gyro showes 50-55 Degrees.
Sensitivity = 0.716454545 - When i move my object 90 Degrees, the gyro showes 83-88 Degrees.

Those drifts just getting worse every move so after few movements the gyro isn't helpfull.

Any ideas ?
14  Using Arduino / Sensors / Re: Gyro Angle calculations isn't precise ? on: November 06, 2011, 05:11:17 am
Updated with full code, hope you can understand.
15  Using Arduino / Sensors / Gyro Angle calculations isn't precise ? on: November 06, 2011, 04:45:33 am
Hey,

I'm using this LISY300AL Gyro: http://www.sparkfun.com/datasheets/Sensors/LISY300AL.pdf
But i cant get a precise data..

Here is my calculation:
Code:
//Global Gyros
float sensitivity;
long Threshold = 2;

//Gyro 1
float gyroZero;
float gyroAdc;
float gyroRate;
float gyroRotation;
float gyroAngle;
long stime = millis();
long dtime = 0;

    float calculateGyroAngle(int pin)
    {
        gyroAdc = analogRead(pin);
        if(abs(gyroAdc - gyroZero) <= Threshold)
          gyroAdc = gyroZero;
        gyroRate = (gyroAdc-gyroZero)/sensitivity;
        gyroRotation+=gyroRate*dtime/1000;
        gyroAngle = abs((gyroRotation - 360 * ceil(gyroRotation / 360))); // Round up between 0-360
        dtime = millis() - stime;
        stime = millis();
        return gyroAngle;
    }
    void InitGyro(int pin)
    {
        sensitivity = 0.716454545;
        gyroAdc = 0;
        gyroRate = 0;
        gyroRotation = 0;
        gyroAngle = 0;
        gyroZero = calibrateGyro(pin);
    }

    int calibrateGyro(int pin)
    {
        long resultGyro = 0;
        for(int i=0;i<100;i++)
        {
            resultGyro += analogRead(pin);
            delay(1);
        }
        resultGyro = resultGyro/100;
        return resultGyro;
    }

I dont get a precise angle, i move my object 90 degrees but the gyro drifts too much so it showes something else...
Maybe i'm doing something wrong ? or i should just add an Accelerometer to make it more precise ?
Pages: [1] 2 3