Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Sensors / Re: MPU6050 + HCM5883 pleas help on: July 01, 2013, 04:48:20 pm
I used the first setup you mentioned and it worked fine for me.  I am guessing you are not properly loading the HMC5883 library properly in your sketch.  Can you post the top part of your code?
2  Using Arduino / Sensors / Re: MPU6050 sample rate 100 Hz on: June 28, 2013, 10:44:19 am
The i2C MPU6050 library has parameters that set the sample rate of the accelerometer and gyro.
3  Using Arduino / Sensors / Re: Measuring inclinations of a moving vehicle with an accelerometer on: June 26, 2013, 12:51:22 pm
You are going to need more than one sensor to accomplish this.  At rest, you can easily get an angle from an accelerometer by determine the director of the of vector caused by gravity.  However, for a moving car, there are other accelerations which will interfere with the acceleration due to gravity alone, so you will need another sensor such as a gyro to help determine the real angle.  Using a gyro you can integrate the rotational velocity to get rotational position and apply that to a recently known accelerometer angle data point to get the current angle.  The MPU6050 is a good sensor for this as it has an accelerometer and gyro on it.  It also has a DMP which allows you to directly output euler angles or yaw/pitch/roll values which will save you having to write your own algorithms.  Jeff Rowbergs i2C library will come in very handy if you decide to go this route.  Good luck.
4  Using Arduino / Sensors / Re: Location in space of a rotating object on: June 20, 2013, 07:22:46 am
If you are wanting to know the orientation of something spinning around an axis at 80-200 rpm, I think a gyro is not what you want.  You probably could use something like a wheel speed sensor to determine the angle of rotation it is currently at. 
5  Using Arduino / Sensors / Recommendation for a high frequency GPS module? on: June 19, 2013, 11:41:15 am
I am looking for GPS module that updates at least 20hz to hook up to my Uno R3 at a reasonably price.  Any suggestions?  There are so many to choose from, I want to know if anybody has personal experience and can recommend one that they personally have used.

Thanks in advance.
6  Using Arduino / Sensors / Re: MPU6050 Help on: June 12, 2013, 04:55:24 pm
That makes a ton of sense! thank you for clarifying! i never would have known that, i thought it measured the position based on gravity or something. so if i use the dmp example from Rowberg's library i should be able to get the pitch and roll?
also, thank you for offering to look at the libraries. i will change #include "Wire.h" to #include <Wire.h> and see if that helps. thanks!

Yeah, when I said it was a common misconception, I meant that I myself made that mistake when I started out playing with sensors. :-).  Actually the accelerometer is more instrumental to determining the pitch and roll than the gyro.  The accelerometer measure accelerations, so when at rest when laying flat the acceleration due to gravity should register 1G (when converted from raw value) in the -Z direction.  As the sensor rotates you can tell the pitch and roll by determining the how the acceleration due to gravity vector changes.  However, other accelerations will interfere with this, so using the fusion of accelerometer and gyro data together you can get pretty reliable pitch and roll.  You can also get yaw, but only relative yaw, since there is no magnetometer to tell you magnetic north as a baseline.  Rowbergs code which accesses the DMP of the MPU6050 does this automatically for you, it is like a black box of calculations that we don't have access to, but we can get yaw/pitch/roll outputs from it. 
7  Using Arduino / Sensors / Re: MPU6050 Help on: June 12, 2013, 02:52:50 pm
In the example sketch, it says #include "Wire.h", you could try #include <Wire.h>.

The error message is about the use of 'SPI' in the functions in I2Cdev.cpp
But I can't find 'SPI' anywhere in that file
So I don't know how you got that message, it seems impossible.
Is your I2Cdev.cpp the same as the one in the link ?
Do you have a lot (too many) libraries installed mixed with older ones or with the same name that were downloaded from different locations ?

I've gotten those same errors before trying to compile with the i2Cdev library.  I don't remember what I did to fix it, but I remember maintaining two sets of the i2C library, the original one, and my modified one which actually compiled.  When I get home later today, I will try to compare the two and see if I can figure out what the problem was for me and see if it is the same for you.  I haven't used Rowberg's code in awhile, I have been playing around with FreeIMU libary (which also uses i2CDev).
8  Using Arduino / Sensors / Re: MPU6050 Help on: June 12, 2013, 02:50:18 pm
also, the gyro always goes back to 0 for all the axes after i stop moving the board, even when they should not be 0. its like it recalibrated itself. it seems to do it every time it prints out the values in the serial monitor. i really have no idea what is going on.

The gyro should go to zero whenever it is not moving.  The gyro measures angular velocity, so when it is not moving, it measures zero.  A common misconception is that gyro's measure anglular position, but they do not.  However, by integrating the angular velocity, coupled with accelerometer data,  you can get relatively good pitch and roll data.  Rowberg's code that accesses the DMP can calculate Yaw, Pitch and Roll (though the yaw is subject to drift without a magnetometer). 
9  Using Arduino / Sensors / Re: mpu-6050 i2c library interrupt issue/ hmc9883l 9dof solution on: June 07, 2013, 08:29:38 am
FreeIMU library does just that.  Unfortunately the guy behind FreeIMU, Fabio Varesano passed away 6 months months ago, so support is limited.  However, his website has links to his forum and the library.  You do NOT need his FreeIMU hardware to use his library.  I used a MPU6050 with a HMC5883L attached to the aux i2c and it worked great.

He uses a sensor fusion algorithm called a MARG orientation filter.

If you use his libary, you will need to modify the freeIMU.h file to define the sensors you are using, to make sure it disables the barometer since you don't have one.  But it is very simple, the code is already there, you just have to comment out a line and uncomment out another.  Fabio designed the libary to be used with all sorts of variations of hardware.
10  Using Arduino / Sensors / Re: Sensor to detect movement and position on: June 06, 2013, 03:10:35 pm
I want to mount a sensor in an object that will lie flat most of the time.  But when it's picked up and moved I want to be able to detect that.  Just an accelerometer isn't good enough because I also need to know if it's flat and right-side-up.  An accelerometer will notice the object is moving, but when they put it down again, I need to know if it's flat and right-side-up.  This is going to be battery powered, so I need a low current solution.  Ideally, something that will sleep until there's movement.  Any suggestions?

An accelerometer will work to detect movement, and to detect the angle it is resting at.  The Z axis of the accelerometer should register the acceleration due to gravity while at rest and flat.  If the sensor is at an angle, the value of the Z axis will change.
11  Using Arduino / Interfacing w/ Software on the Computer / Re: cannot read the data from arduino to the c# on: March 10, 2013, 08:24:51 am
Without seeing your C# code or a more detailed description of the problem,  I cannot help you as I do not understand what the problem is.
12  Using Arduino / Sensors / Re: how to increase the sample rate(Use arduino as DAQ) on: February 20, 2013, 12:14:51 pm
Set your bad rate to 115200, and remove the delay command.  That will run the loop as fast as it can and output to serial at the highest data rate supported.
13  Using Arduino / Sensors / Re: Calculating Vehicle Position with an IMU on: February 18, 2013, 10:14:59 am
I had an old Stack data acquisition unit for my kart.  Thing is probably 10 years old or older now.  It had an accelerometer in it which it used to derive track maps.  This was a long time ago, and it didn't use a gyro or magnetometer, just an accelerometer.  The track maps visually looked very accurate, although I can't say exactly how accurate, and to scale they were, but visually it did a very good job.  Accelerometer data is very noisy, so if you are just integrating the raw data, I would imagine the results to be awful.  You are going to want to use some form of complimentary filter or Kalman filter to integrate to determine your position.

Reasonable track maps can be derived from accelerometer AND a wheel speed sensor. However, remember this is also on a track and typically defined over several lap iterations.

My kart didn't have a wheel speed sensor, and it generated a map EVERY lap.  The software allowed you to choose which lap to use to generate the map, they all looked pretty similar though.  I would doubt the accuracy of the maps was very good, but for a visual representation of a lap it was quite good.  I the original poster seems to not need great accuracy, but wants a general position and good visual representation of path.  I think it should be quite possible with just an accelerometer for his purposes.  I am working on something similar, only I want to use GPS + accelerometer data and fuse it together.  Civilian GPS units generally only update @ 1-20hz, while many accelerometers can easily run at 100+ hz.
14  Using Arduino / Sensors / Re: accelerometer/magnetometer on: February 06, 2013, 10:48:02 am
It depends on what you want it to do.  Technically, you can do it with just an accelerometer.  Or just a gyro if you wanted.  Generally, the best way to go for an accurate yaw/pitch/roll measurement you would want all 3, accel, gyro, & mag.  Without a magnetmometer, your measurements will be subject to yaw drift.  Without a gyro, your yaw/pitch/roll measurements will not be very accurate, especially when the sensor is subjected to bumpiness. Your yaw/pitch/roll readings would only be valid  if the accelerometer were rotating smoothly and slowly, or steady-state positioning. 
15  Using Arduino / Sensors / Re: Angular position measuring on: February 06, 2013, 10:43:28 am
You might also look into hall effect sensors if you want your inverted pendulum to run for long periods of time, and don't want to worry about a potentiometer wearing out.
Pages: [1] 2 3 ... 5