Detecting lean angle on a motorcycle

Hi all,

I was originally going to use an accelerometer to detect lean angle on a motorbike but then actually thought about it and realised it was not going to work, at least not while cornering!

So I have been thinking about using a gyroscope. But will it measure absolute angle or the rate of change of angle? I have searched the net but have not found an answer (at least not one definitive enough for me to understand).

Thanks

Z

I was originally going to use an accelerometer to detect lean angle

For what purpose? If nothing's dragging, you're not leaned over far enough. If something is, you are.

Hi, This guy has done some of this: http://www.yourduino.com/bike-stuff.htm

Thanks for the replies

@PaulS

For what purpose?

The usual purpose - The usual - Pure interest! My days of dragging anything while cornering (especially on the old British bikes I ride) are long gone.

@Terry I looked at that project some time ago. He uses an accelerometer and has found that the readings were less than accurate.

Before I get hold of a gyro I was just wondering whether they gave out a reading of angle or rate of change of angle (I suspect the latter)

Z

"Before I get hold of a gyro I was just wondering whether they gave out a reading of angle or rate of change of angle (I suspect the latter)"

You program your processor to take readings at a steady rate than look at the readings over time to determine the rate of change.

For example, at time x the angle was 5 degrees. 100 mS later it is 10 degrees - thus the rate of change was 5 degrees/0.1S, or 50 degrees/second.

I don't understand the confusion here.

How about aviation gyroscopes? Those are only a few $K. I don't know if they have digital outputs, I don't have anything that fancy in my airplane, it is visual only. Try browsing tradeaplane.com http://www.trade-a-plane.com/keyword-search?s-type=&keyword=turn+and+bank+coordinator

After it opens, click on Parts/Products.

sbright33: It is not possible to measure lean angle with an accelerometer. Did I spell that right? Because the force is always down, no matter how far you lean while riding. I mean with respect to the motorcycle it's the same. By definition! A cheap gyroscope also does not work. I've tried many models. I can explain if you like. I have had success with a model costing nearly $100K used to guide missiles. There is a better way. All you need is GPS! If you can calculate the radius of the curve it's easy to derive lean angle accurately. This was verified with the expensive gyroscope. More samples, more frequent updates.

It is very useful for racing. Also to compare tires on different road surfaces. You can see which one leans the most before sliding. This is the quality you are looking for in a racing tire. It is related to my post about measuring a line thru a curve while racing...

http://arduino.cc/forum/index.php/topic,73379.0.html

I'm surprised. If we say the accelerometer is oriented with the y axis front to back, x side to side, and z up, won't the z and x change in absolute value if you lean the bike regardless of the curve? Or does the x continue to read 0G? And wouldn't the z axis reading tell you how hard the bike was turning?

sbright33: Hey somebody deleted their comment! Makes me look like I'm talking to myself.

my bad.

Maybe something like this http://www.watson-gyro.com/products/rate_gyro_ARS_spec.html Says its "low cost" ...

GPS works.

Got any working examples of GPS being used to determine motorcycle lean angle?

This might be the way to go

http://www.sssj.co.jp/en/index.html

http://www.sssj.co.jp/en/products/gyro/crs05.html "CRS05 is a high-temperature automotive-qualified gyro and has been supplied to European market for years."

Maybe find a wrecked European car and pull one of these out?

The usual purpose - The usual - Pure interest! My days of dragging anything while cornering (especially on the old British bikes I ride) are long gone.

So, you're going to measure how far you can lean (statically, I presume), and program an Arduino with LCD and additional hardware, and measure and display how far you are currently leaning. Then, in the middle of a curve, you'll be looking at the display to see if you can lean further. Well, OK.

Me? I just angle my foot out a little. When my foot brushes the ground, I know hard parts aren't far behind.

sbright33: If I understand your axes correctly... The X will always read 0 statically, even during a steep banked curve.

Ok, I'll just shut up and assume this is correct - i wasn't even thinking of a banked turn which would, obviously complicate the lean angle thing even for a gyroscope.

sbright33: Z CAN be used to measure lean angle combined with speed, in theory. It's like that feeling you have when you spin as a kid pushing you outward. In reality it doesn't work accurately. Too much vibration and bumps in the road? How accurate is the accelerometer?

Assuming a car which does not have shocks... It's still difficult to measure accurately! In this case the X axis. Let's say you want to measure cornering forces. Drive the same corner over and over. Each time the measured results are different. Every reading 100x/sec fluctuates when it should be nearly constant. Multiply this error by 10x when you are not able to measure X using Z instead.

I'm quite sure that this part is true.

Probably need to establish what the lean angle is in relation to, gravity, the surface of the track, or other. If it is the surface of the track, then maybe the balancing bot approaches might be worth studying.

This fellow http://www.janspace.com/b2evolution/arduino.php by the way, calmly uses the x accelerator reading to calculate and display the lean angle(found this from the 1st reply above). - i'm still not convinced this is hopeless.

Want the formula? It's a 100 line algorithm.

The request was for a working example, not wishful thinking. :)

Wishful thinking??? It works in real time too, but I'm not sure if it was ever used commercially.

http://arduino.cc/forum/index.php/topic,73379.0.html :)

My understanding from reading diydrones.com and (many) years ago working for Norden, is that the semiconductor process based gyros are RATE gyros, showing the rate of change of angle. Usually used with systems that are calculating the rotation based on the rate.

In an F4 (which I'm more familiar with) or an F16 there are XYZ attitude measurement mechanical gyros that are used for various calculations like bombing. But when the pilot does a violent maneuver all those gyros "dump" and only after things settle down again is the data from the rate gyro used to reorient the XYand Z gyros.

I worked on the "Gyro Centering Amplifiers" and we found they often failed after a gyro was "dumped" and the (servo) amplifier tried to recenter the gyro. After a bunch of experiments in the White Room at Norden I decided the germanium! diodes used in a reference bridge were being overloaded during the dump, and built 3 amplifiers using NewFangled SILICON diodes. 1N645s. 1960. After a big fight with the original designer who had apparently previously been infallible, all of them were reworked.

But I don't think you asked me THAT :roll_eyes:

I bet some airplane type guys could explain all this...

I think the bottom line is that all the solid state "gyroscopes" can be affected by forces that are in play beyond those from axis rotation. The old mechanical rotating gyroscopes are somewhat more immune to external forces by being allowed to remain in the position in which they want to remain. I think the solidstate units are probably based on a "quartz tuning fork" setup.

bill2009: ... calmly uses the x accelerator reading to calculate and display the lean angle(found this from the 1st reply above). - i'm still not convinced this is hopeless.

if the bike is stationary an accelerometer would work, but when the bike is moving the accelerometer won't work because it senses the same force as the rider, i.e. the rider feels his own weight pressing down into the seat, not down towards center of the planet earth. This is because the centrifugal force generated by going around a bend is exactly balanced by the bikes lean angle.