1. ## Question about accelerometer and gyro sensor

Dear members of forum,

Can someone please explain what are the differences·between a gyro sensor and an accelerometer,·in terms of specs and application? Can both be used interchangably? And is it suitable to use an accelerometer for making a segway type robot. Thank you in advance.

2. A gyro spins and determines direction based on a flywheel's response to the environment around it. In some cases, it could be independent of gravity.

An accelerometer is mesuring forces in terms of gravity's acceleration. No gravity, no data.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
···················· Tropically,····· G. Herzog [·黃鶴 ]·in Taiwan

3. need input, more input, thank you.

4. A gryo will give you angular deviation from a given axis, independent of gravity (i.e., it works in freefall and it will not be subject to centrifugal force nor acceleration). An accelerometer measures "g-force" or gravity and/or motion against gravity.

If you are looking for "absolute" orientation for segway like 'bot, a gryo might be better -- otherwise when you move forward quickly, for example, your accelerometer may think you are tilting when you are not.

On the hobby side of things, you can purchase gryos from R/C supply houses (they are used in helicopters and for auto-pilots) for < \$100. They output a pulse similar to R/C receivers (servo pulses) so you can measure the output with PULSIN on a Stamp.

That said, accelerometers are cheaper and smaller, so you may want to experiment -- if your 'bot is not turning nor accelerating very quickly, you may be able to get away with it.

More theoretical info:

en.wikipedia.org/wiki/Accelerometer

en.wikipedia.org/wiki/Gyroscope

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

5. P.S. -- if you want your balancing robot to be cheap and small, many users have built balancing 'bots using distance sensors (either IR or sonar) to measure distance fore and aft to the "ground" -- get the distance in the right place, and you're balancing. The downside of this approach is that you can not balance on an incline (the platform may be "straight" up, but the distance measure fore or aft will be too high or too low due to the incline of the "hill"). Do a search of the forums in completed projects and you'll turn up some nice examples of this approach with table-top Boe-bot sized platforms.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

6. www.sparkfun.com has gyros. Parallax has accelerometers.

I really tried to keep my explanation as short as possible because the long winded ones seem to confuse beginners. Gyros are more capabable of doing many things, but they require a spinning wheel that can malfunction and that usually uses a lot more electricity.

In some cases, they are both doing the same job. It is the grey areas, where they are similar that tends to confuse people.

Wikipedia is always a good place to start. And they refer you to go websites. For complete control, you would want gyros on 3 axis AND accelerometers on 3 axis. I believe that is called the 6 degrees of freedom. You need all of them for genuine whizbang robotics - like making your airplane do a flip and a loop and come out exactly right.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
···················· Tropically,····· G. Herzog [·黃鶴 ]·in Taiwan

7. Thank you for the insightful explaination, think I got the idea now. Did try using two pairs of IR sensors on my boebot but it rattles so hard gives me a headache looking at it. rgds.

8. Gyro Types

Basically you have two types, mechanical and piezo. I do not think anyone still sells the old mechanical gyros but if you bought a used helicopter it is possible you may have one. The mechanical gyros will have a buzzing sound coming from the sensor unit. They use an electric motor with two flywheels, one on each end of the motor shaft. And this is where the noise comes from. To understand how it works hold a spinning bicycle wheel by the axle and try to turn it, you will feel it resist you moving it. The flywheels in the mechanical gyro are mounted on a pivot and a sensor measures the deflection of the motor/flywheels when the helicopter makes a sudden movement. The piezo type gyros work with no moving parts. It uses a triangular crystal with a piezo element on each side. The piezo element is used in a lot of watches to make the beep sound from the alarm function. The material not only can make sound but also sense it. So it is used in both speakers and microphones. Two of the piezo elements on the crystal are set to sense vibration and the third one is setup to vibrate. When the helicopter is not rotating the vibration traveling through the crystal hits the other two piezo elements at the same time. When the helicopter is rotating one sensor will have a stronger signal then the other. It is a very efficient design and has a lot finer degree of resolution then the mechanical type. In addition power consumption is greatly reduced as there is no spinning motor to power.

What is the difference between heading hold (hh) and standard rate (non-hh).

In non-hh mode the gyro just dampens unwanted movements of the tail. To keep things simple lets say you are hovering and a constant wind hits the helicopter from the side, the gyro will keep the helicopter from suddenly swinging nose into the wind, but the helicopter will eventually drift nose into the wind. All the gyro does is to prevent any jerk type reaction.

In hh mode the gyro will keep the nose pointed in the same place until you tell it to move. You can fly sideways with the rudder stick in the center and the nose will remain pointed in the same direction.

If you have not used heading hold before then you will notice in fast forward flight that when you make a turn, the tail will not follow the helicopter, you have to give some rudder in your turns. Another thing is that you'll notice the rudder stick feels different. In heading hold, the amount you move the rudder stick from center tells the gyro how many degrees per second that you want the helicopter to rotate. The gyro moves the rudder servo however much it needs to obtain the requested rotation rate. With a standard rate gyro if you did a slow pirouette (one rotation) with the wind then to keep the helicopter spinning at the same rate you would have to move the rudder stick more as the tail is going upwind and less as the tail goes downwind. But with a heading hold gyro, it will tell the rudder servo to move more or less to maintain the constant rate, you just keep the rudder stick in one place.

Due to typical marketing ploys you will see many names for heading hold. They all are just different names for the same thing. The different names are just because each company wants to make it seem like their version is more special then another companies.

AVCS = Tail Lock = Smart Lock = Heading Hold

Carl

9. i found one gyro sensor Epson XV-3500CB, apparently it is the latest and tiniest chip in the market, at US35/pc it is still cheaper than others.