Answers.Body: <p>As you say yourself, you want to detect the tilt of the pendulum rod, so I'm assuming what you're after is actually its angle. Measuring anything else would probably result in tedious calculations anyway; and in addition, considering you'll want to try to keep the angle in a specific range, you'll need to know it.</p>
  
  <p>As such, an angle sensor may seems the most logical choice; but a gyroscopic sensor will not only offer you the angle, but some indication of the current rotation speed as well, which will be useful if you want to mimic the behaviour of a servomechanism.</p>
  
  <p>However, these two sensors are single-axis only, which means that if you want the rod to be able to swing in more than one dimension, you'll have to use one sensor per axis, which may prove cumbersome to build. In that case, the acceleration sensor is probably better.</p>
  
  <p>All in all, all 3 sensors are probably usable somehow, but it really depends on what exactly it is you want to build, and what you've tried so far. I'd also recommend searching for similar projects; for example, there are numerous NXT "segway" robots out there, and there's a <a href="http://robotsquare.com/2012/03/13/tutorial-segway-with-nxt-g/" rel="nofollow">detailed tutorial on how to build one with a gyroscopic sensor</a>. Note that the feat seems to be possible even using a simple <a href="http://www.nxtprograms.com/NXT2/segway/" rel="nofollow">color sensor</a> to detect ground proximity instead of knowing the exact angle.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-31T11:59:46.830Z
Answers.Text: Check out the dIMU sensor which provides both accelerometer and gyroscope for all three axises in one sensor. It doesn't have a nice casing though.
Answers.UserDisplayName: Sebastian Wahl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-08-01T07:33:03.933Z
Answers.Text: [dIMU Inertial Motion Sensor link](http://www.dexterindustries.com/dIMU.html)
Answers.UserDisplayName: Joubarc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-04-04T07:40:04.787Z
Answers.LastActivityDate: 2013-04-04T07:40:04.787Z
Answers.UserDisplayName: Joubarc
Body: <p>I want to build a balancer for an inverted pendulum. Which of the following sensors is best suited for detecting the tilt?</p>
  
  <ul>
  <li>Accelerometer</li>
  <li>Gyroscope</li>
  <li>Angle sensor</li>
  </ul>
  
Tags: <nxt><mindstorms><building>
Title: Best sensor for balancing inverted pendulum
UserDisplayName: norq
ThreadText: # Best sensor for balancing inverted pendulum
  
  (Asked by: username_0 on 2013-04-03)
  
  I want to build a balancer for an inverted pendulum. Which of the following sensors is best suited for detecting the tilt?
  
  * Accelerometer
  * Gyroscope
  * Angle sensor
  
  **Tags:** nxt, mindstorms, building
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2013-04-04. Score: 4 | Accepted answer
  
  As you say yourself, you want to detect the tilt of the pendulum rod, so I'm assuming what you're after is actually its angle. Measuring anything else would probably result in tedious calculations anyway; and in addition, considering you'll want to try to keep the angle in a specific range, you'll need to know it.
  
  As such, an angle sensor may seems the most logical choice; but a gyroscopic sensor will not only offer you the angle, but some indication of the current rotation speed as well, which will be useful if you want to mimic the behaviour of a servomechanism.
  
  However, these two sensors are single-axis only, which means that if you want the rod to be able to swing in more than one dimension, you'll have to use one sensor per axis, which may prove cumbersome to build. In that case, the acceleration sensor is probably better.
  
  All in all, all 3 sensors are probably usable somehow, but it really depends on what exactly it is you want to build, and what you've tried so far. I'd also recommend searching for similar projects; for example, there are numerous NXT "segway" robots out there, and there's a [detailed tutorial on how to build one with a gyroscopic sensor](http://robotsquare.com/2012/03/13/tutorial-segway-with-nxt-g/). Note that the feat seems to be possible even using a simple [color sensor](http://www.nxtprograms.com/NXT2/segway/) to detect ground proximity instead of knowing the exact angle.
  
  > **Comments:**
  > **username_2**: Check out the dIMU sensor which provides both accelerometer and gyroscope for all three axises in one sensor. It doesn't have a nice casing though.  
  > **username_1**: [dIMU Inertial Motion Sensor link](http://www.dexterindustries.com/dIMU.html)  
  
  ---
  
  