Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Digital spirit-level, which sensor?


  • Please log in to reply
12 replies to this topic

#1 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 November 2010 - 03:11 PM

Hi there, i have a question for a project that bugs me for some time now, because i dont know which sensor to use. If i want to measure the angle a camera is flipped to the front (lets call it x-axis so the lens is looking to the ground) and to the side (lets call it y-axis so the camera would make a portrait instead of a landscape photo) which kind of sensor would i have to use? Do i have to use a accelerometer oder do i have to use a gyro?

#2 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 17 November 2010 - 03:23 PM

Hi there,
i have a question for a project that bugs me for some time now, because i dont know which sensor to use.

If i want to measure the angle a camera is flipped to the front (lets call it x-axis so the lens is looking to the ground) and to the side (lets call it y-axis so the camera would make a portrait instead of a landscape photo) which kind of sensor would i have to use?

Do i have to use a accelerometer oder do i have to use a gyro?

You could use a 2-axis accelerometer for this. It will provide data that you can use to determine the orientation of the camera.

#3 Marius

Marius

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationCenturion RSA

Posted 17 November 2010 - 03:50 PM

Alfred, I don,t think a accelerometer will work as it gives a signal corresponding to the acceleration through an angle. Once the movement is stopped there will be no more signal. In this case a gyro will work better as it gives a constant output as long as the axis are not aligned to horizontal or vertical.
If at first you don't succeed, then try and try again.

#4 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 17 November 2010 - 03:58 PM

Alfred,
I don,t think a accelerometer will work as it gives a signal corresponding to the acceleration through an angle. Once the movement is stopped there will be no more signal. In this case a gyro will work better as it gives a constant output as long as the axis are not aligned to horizontal or vertical.

You may be right, however the accelerometer that I am using will report both static orientation and movement.

This is the one I use http://www.parallax....93/Default.aspx

I have not yet used it with the Netduino, but it works great with the BasicStamp.

#5 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 17 November 2010 - 04:22 PM

Accelerometers generally should detect gravity as acceleration.

#6 Marius

Marius

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationCenturion RSA

Posted 17 November 2010 - 06:01 PM

Is it maybe a combined sensor?
If at first you don't succeed, then try and try again.

#7 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 November 2010 - 06:19 PM

Xou see that is the problem i have. I think an accelerometer will only work if i have an acceleration. You are right if you say that gravity put on an acceleration all the time, but will this be enough to measure an angle? And what about movement in both direction, if i move the camera to the front and roll it to the side how will this effect the values i get? By the way the Memsic 2125 seems to be a little bit specuail, because it says that it can measeure tilt on two axis and rotation on one axis.

#8 Marius

Marius

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationCenturion RSA

Posted 17 November 2010 - 06:39 PM

Alfred, From what you are saying I am sure that the sensor will not work for what you want to do. This is why: An accelerometer will give output when it moves from any steady state to the next. The rate of change produces an certain output. The output is proportional to the rate of change through the angle. By measuring the rate of change output, you can determine how far you have moved. This is normally angular displacement. Once the movement seizes, the output will drop to zero. Now a gyro on the other hand will measure an angular position. It will give an output proportional to the angular position from a reference. This is what you want to measure. You do get solid state gyros that dont make use of centrifugal force to measure the angular error.
If at first you don't succeed, then try and try again.

#9 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 17 November 2010 - 07:35 PM

Alfred,

From what you are saying I am sure that the sensor will not work for what you want to do.

This is why: An accelerometer will give output when it moves from any steady state to the next. The rate of change produces an certain output. The output is proportional to the rate of change through the angle. By measuring the rate of change output, you can determine how far you have moved. This is normally angular displacement. Once the movement seizes, the output will drop to zero.

Now a gyro on the other hand will measure an angular position. It will give an output proportional to the angular position from a reference. This is what you want to measure. You do get solid state gyros that dont make use of centrifugal force to measure the angular error.


I think you might be referring to the original poster, and I imagine what you are saying is correct. However I want to add that the accelerometer that I have been using seems to behave identically to the accelerometer in the iPhone and the iPad in that it CAN indicate the orientation of the device whether or not the device is moving. It can also update the orientation information in realtime as the device is moving.

Check out these notes on the Memsic 2125 Dual-axis Accelerometer

http://www.parallax....c2Axis-v2.0.pdf
http://www.parallax....ltDispCntrl.pdf

-AlfredBr

#10 Marius

Marius

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationCenturion RSA

Posted 17 November 2010 - 07:54 PM

Alfred Sorry about confusing you with the poster. The sensor that you use is a combined sensor. Hence the ability to provide angular position. It would seem that the sensor could be used to show angular movement in any direction from the horizontal plane if you correlate the two signals. Nice sensor!!
If at first you don't succeed, then try and try again.

#11 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 17 November 2010 - 08:00 PM

Alfred

Sorry about confusing you with the poster. The sensor that you use is a combined sensor. Hence the ability to provide angular position. It would seem that the sensor could be used to show angular movement in any direction from the horizontal plane if you correlate the two signals. Nice sensor!!

Yes, it is a fun sensor...and it is available at RadioShack!

#12 Paul

Paul

    Member

  • Members
  • PipPip
  • 14 posts

Posted 17 November 2010 - 08:37 PM

Hi there,
i have a question for a project that bugs me for some time now, because i dont know which sensor to use.

If i want to measure the angle a camera is flipped to the front (lets call it x-axis so the lens is looking to the ground) and to the side (lets call it y-axis so the camera would make a portrait instead of a landscape photo) which kind of sensor would i have to use?

Do i have to use a accelerometer oder do i have to use a gyro?


Just a note on using a gyro. All of the solid state gyros, MEMS gyros, that are readily available be they one, two, or three axis measure the angular rate, i.e. velocity, of rotation about each axis. You will see the the gyro's range listed as degrees/sec, e.g. 100 degrees/sec. This is the maximum angular rate the gyro can report. It is output as an analog voltage, there are some digital output MEMS gyros available. The analog voltage ouput is generally a range from 0 to a few hundred millivolts. For most gyros the "at rest," i.e. no movement, voltage is a positive voltage in the middle of the output voltage range. A clockwise rotation of the gyro on a given axis will generate a positive voltage, which will be reflected as a voltage higher than the at rest voltage and a counter clockwise rotation of the gyro will generate a negative voltage which will be reflected as a voltage lower than the at rest voltage. Through A/D conversion and application of the proper scaling factors the output voltage of the gyro is converted to the angular rate of the gyro.

The important thing to note here is that the gyro is not reporting the angle it has rotated through. It is reporting the angular rate of the rotation it has undergone. To obtain the actual angle the gyro has passed through requires integration of the the angular rate over the elapsed time of the rotation - a nontrivial exercise.

This weekend I will be adding a two axis MEMS gyro to a Netduino based project and will be posting the results of calibrating it, measuring angluar velocity and hopefully an algorithm for integrating over time to get the angle of rotation.

Paul

#13 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 18 November 2010 - 09:33 PM

Okay seems that the problem is not that simple to solve. I am interested in your results.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.