Go Down

Topic: Sensor & Servo interfering [PROBLEM] (Read 1 time) previous topic - next topic

freak174

Oct 07, 2012, 03:27 pm Last Edit: Oct 08, 2012, 02:42 pm by freak174 Reason: 1
Hello peeps,

Maybe I should start by telling you what I am doing so you can get a perspective of my problem and maybe give me a helping hand.

I have a sensor called Triple Axis Accelerometer & Gyro Breakout - MPU-6050 , and Ive managed to get it working. I can get the information I want from it.
And to get the information I want from it Im using the interrupt function.  So the interrupt part is a big factor of the problem I will tell you about.

So Ive tried to expand the code further, by adding servos.
What Im trying to do is to control the servos depending on the values the sensor is generating. It works out, for a couple of seconds.

The problem is now that, after these couple of seconds the values from the sensor gets screwd up. Getting values that I shouldnt get.

Conclusions:
The servo and the sensor are overflowing the fifobuffer.

Help appreciated, cheers!

Edit:
Link for the code im using
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/Examples/MPU6050_DMP6/MPU6050_DMP6.ino


DuaneB

How are you powering the servos ?

Check the two links in my signature for why this maters

Duane B

rcarduino.blogspot.com

freak174

I followed your advice but I still have the same issue as before.
But I will continue with using external battery to supply the servo, so thanks!

This is an answer I had from an other site but I dont know how to go any further.
Quote
Well, yeah, if you are getting FIFO overflow, you are not emptying it out in time so something must be using too much time. If you are generating PWM signals for the servo with the same processor that reads the MPU then you could easily overflow the FIFO. I mean if THAT'S your configuration. It also means your sensor is set for free running reads.


Please help me go further!

PS. DuaneB, nice projects uve done!


Go Up