Best way to get lean angle of a motorcycle
Jim Fouch
Posts: 395
I'm looking for a way to determine the lean angle of a motorcycle (In motion of course). I have used a basic 2 axis accelerometer, but after the initial roll in to a turn, the tilt value that is normally accurate when the accelerometer is stopped, becomes affected by the bikes centrifugal forces of it wanting to slide out of the turn.
I have a single axis electronics gyroscope that is used in RC helicopter applications to help stabilize them, but have not interfaced with it yet. I also don't know if the outputs would always have level as center. I also don't know if it would be affected the same way the accelerometer is.
I’m also considering creating an old school motor type Gyro and having some pots on it for readings.
The main purpose for this is to have a camera mount that will adjust for lean angles and also wheelies. Basically, instead of having the camera point at the sky, it will actually look like a person is following the bike.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
I have a single axis electronics gyroscope that is used in RC helicopter applications to help stabilize them, but have not interfaced with it yet. I also don't know if the outputs would always have level as center. I also don't know if it would be affected the same way the accelerometer is.
I’m also considering creating an old school motor type Gyro and having some pots on it for readings.
The main purpose for this is to have a camera mount that will adjust for lean angles and also wheelies. Basically, instead of having the camera point at the sky, it will actually look like a person is following the bike.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
i though about it a bit, and i think you can estimate the tilt angle with just 1 Axis accelerometer.
here is how:
1. fix the accelerometer with the axis pointing up/down.
2. measure the accel reading when fully upright (to get gravity value)
3. obtain the tilt angle from the following formula:
alpha = arcsin( g / x )
where:
alpha - current tilt angle (fully upright is 90 degrees)
g - accel's reading in fully upright
x - current accel reading
this should work for a motorcycle in a reasonably steady state (i.e no bumps, sudden elevation changes, sudden wheel turns, etc)
- heading change rate (delta heading / time interval), this will function the same as vertical gyro with lower data rate
- ground speed
The lean angle will be the function of those two measurement, some thing like these :
lean_angle = atan(gps_ground_speed / 9.81 * heading_change_rate);
where 9.81 is gravity constant at your location. You can fine tune the result with some constant or non linear function.
regards
-doni-
regards
-doni-
Thoughts
1. Why not just mount it on your helmut? (Because thats no fun, I know).
2. If you know the speed, and a rough weight of the bike, you could accurately determine how much force is being contributed by speed to the lean angle, I think, Im gonna half to sit down and do the math on that. Also knowing the speed will make the "wheelies" a lot easier to figure out, as they would seem to look the same as the bike accelerating/ compression loading the suspension, I would say it would be simplest to get front and rear wheel speed. Most modern motorcycles use a 5v hall sensor for front wheel speed so that should be easy, and knowing that, you can inductively pick up rpm that would give you a "rear" wheel speed and in reference to front wheel speed shouldn't be to hard to determine the gear you are in. So thats the hard math way, but maybe, If you need the math for it, shoot me a PM.
3. Why not put a ping on each side, and measure distance to the ground, if they were angled right I think you could get all your position information from just two of them. I guess it doesn't half to be a ping but just an ultrasonic range finder, then its just a simple matter of figuring out the angle of the triangle. I am unsure if eventually at a given speed the ping pulses would fail to make it back to the unit, from the relative motion effect.
So left one shortens, its leaning left, they both get longer, its on the rear wheel, ect ect.
Just some thoughts,
Best of luck,
TJ
motorcycle lean angle is kind of tricky to visualize for those who don't ride...even those who do for that matter
This is what I think I understand:
The lean angle is determined the combination of the motorcycle's force vector through the C.G. (gravity and centrifugal) and the rider's force vector through the C.G (gravity and centrifugal). For a constant lean angle turn, viewed from the rear, the sum of the two vectors has to go through the contact patch of the tire...if it doesn't you will not maintain that lean angle Add a little countersteer and things really get a bit more complicated but manageable. For normal riding the rider C.G., the bike C.G. and the contact patch are in a straight line, but since the rider is not strapped into the cycle, but is able to mover around in the seat...you've seen racers hanging off the side of their bikes, right?...GPS and accelerometer data will not work. I think you're down to gyro and ping, and I don't think ping will handle the doplar effect. Depends on the accuracy needed and type of riding necessary, but one could imagine a brute force solution of two wheeled trailer on an articulated (U-Joint?) swivel (rotationally free to move) mount with an encoder to give you a very accurate lean angle.
I'll try the electronics Gyro I have to see what it does. The best way to test it is to film some riding while overlaying the data over the video. That way you simply play back the video and see how well things work.
I do like the idea of the PING, but I wonder if the PING will work well if it's not facing the object (The ground) at 0 degrees. As the bike changes it's angle, the angle of the PING will also change.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
My specific method for measuring lean angle would be to use the second gyro to measure the rate of turn of the motorcycle. For a given rate of turn and speed a motorcycle has one possible lean angle. Just ran through the math. I've attached a scan of it below. atan(w*S/g) = lean angle, this should be a nice well behaved function.
Marty
P.S. The bike lean angle will mess with the response of the second gyro. The best solution is to put the gyro on the level platform with your camera. Otherwise another formula can be generated to correct the rate of turn measurement based on lean angle. This system of equations could be solved each control cycle, or the correction could be generated using the lean angle from the previous cycle. Still, bumps would couple in at high lean angles.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Post Edited (Lawson) : 11/8/2008 7:08:43 PM GMT
www.fmadirect.com/Detail.htm?item=1489§ion=20
If you can isolate the Ping reflections with a tube around each transmitter and recdeiver, you could use two Pings on the plate, and some variation of PID to keep the plate balanced. Using an average of time to calculate t he error, you might be able to get it pretty smooth.
I think that may just work. The Prop could read both PINGs and use the Servo to try to balance them with the resulting position being the true lean angle of the bike.
The lean indicator will be mounted under the bike and the camera mount will be positioned behind the rider.
This would also throw out any issues with other forces. Also when both pings show an equal increase above normal ride height, that would indicate a wheelie.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
I am just curious why my proposition wasn't considered? I though about it some more and it really does seem like it would work well (according to my grade 8 physics diagram). Just put some filter (running average?) on it's input and it should balance out any kind of high frequency noise (like small bumps on the road)
Besides it's 1. cheap (1axis accelerometer) 2. simple. Not sure why one would rather look for exotic solutions (other than for coolness factor [noparse];)[/noparse] )
Using two ADC's and an upside down joystick(using pots) with a weight detects Gforce in right or left turn. Regardless of
lean angle, sensor will tend to want to arrive at 90 degree angle perpendicular to ground at some sufficient Gforce vs
Weight factor. Greater outward Gfoce puts greater pressure on spring, producing info to use as an
offset. Use a speed factor to determine if the bike is moving. At some known speed, the joystick will tend move opposite gravities pull.
There should be some known values of lean angle at X speed based on riding habits given a flat surface track.
If Speed = 0, and Lean = Left, the joystick leans left too. Use Speed to tell the code that the bike is leaning left, with no Gforces, therefor, correct the cam to the opposite direction.
If Speed = 100, and lean = left, the joystick leans right (against gravity), so use Speed and the ADC value to arrive at a lean value to correct that indicates the bike is leaning left still.
Post Edited (Originator) : 11/9/2008 12:21:28 AM GMT
Your idea would work when the bike is standing still or going straight, but not when it's banking in a turn. This is because of the centripetal acceleration vector that gets added to g results in a net acceleration pointing at the same angle the bike is leaning. This is the vector the accelerometer will measure, not g itself. So, from the accelerometer's frame of reference, the bike will seem to be upright. It's for this same reason that a biker's vestibular system doesn't sense an imbalance when the bike is in a turn, since "apparent gravity" still feels like it's pulling "down" relative to the biker's body.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Just a few PropSTICK Kit bare PCBs left!
Use a two axis accelerometer mounted so that each axis points up and out from the bike at a 45 deg angle. Like a Vee when viewed from the front.
When both axis are equal the bike is upright.
When they are unequal but sum to one gee, then you can calculate the static lean angle.
When they are unequal but sum to more than one gee you will be able to calculate the lean angle by the difference in readings and how much more than one gee there is.
For example at 45 deg static lean one will read 1g, the other 0g.
Going 100 mph while leaning 45 deg, one will still read one gee, the other, quite a bit more than zero.
Rich H
Post Edited (W9GFO) : 11/9/2008 1:48:25 AM GMT
thanks for commenting Phil
This is exactly how i see it and here is why i think it will work:
When the bike is upright and standing still (or going along straight line), the only force is gravity, so the pavement exerts the opposite force pointing up, so the bike stays in its place and not going anywhere.
Now, add the centrifugal force exerted on bike/biker once at speed and turning - another force, perpendicular to the gravity and direction of motion. So, since these two forces have to be counteracted, the pavement now has to counteract the geometrical sum of these two forces, thus it exerts the negative sum of gravity and the centrifugal. To stay balanced (and not fall), the bike has to tilt such way so it would be parallel to this sum vector, which means that it is sufficient to simply use permanently mounted accelerometer measuring the vertical acceleration (from the bike's frame of reference) and use the simple formula i gave earlier to calculate the tilt angle
i am very curious to know if there is a flaw in my logic, so please point it out if it's the case
Rich H
indeed Rich that's a shortcoming.
I guess this binary piece of info can be obtained from some cheap radar type of solution (something that would sense reflecting off the ground)
'Sorry, I glossed over your math and jumped to the wrong conclusion. But for the direction issue, as Rich points out, your idea has some merit. You're assuming, however, that the bike+rider's center of gravity always aligns with the bike's vertical axis. This assumption gets compromised, unfortunately when the rider shifts his weight. An additional uncertainty occurs when going through a dip or over a hill crest. As a gedanken experiment, imagine yourself blindfolded, riding on the back of the bike. Could you tell, just by sensing acceleration, whether and how much the bike was leaning?
I wonder, though, if a three-axis accelerometer, combined with speed and steering-angle sensors, might provide adequate data to compute the bike's tilt angle.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Just a few PropSTICK Kit bare PCBs left!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
It seems to me the best solution is two ping sensors, one on each side of the bike, pointing towards the ground. they can be mounted anywhere, just as long as they're mounted at the same height. The lean angle is a simple calculation of the difference in height. You can also take this off one bike and put it on another very easily.
Maybe you could do it with just a single ping sensor, attached to the bottom-center of the engine fairing. Whenever you lean, the bottom gets farther from the ground. You couldn't suppose which direction the bike is leaning, but you would get an angle.
EDIT - thinking about this a bit further - inputs that change the CG will change the angle of the bike, right?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
Post Edited (Nick McClick) : 11/10/2008 8:56:16 PM GMT
The gyro will give you the best instantanous measure of the tilt angle.· Filtered data from the accelerometers minus the centrifugal force will provide a slower response and longer term measurement, which·can be used to correct for drift in the gyro.· I don't think using accelerometers without a gyro will work well because of the noise caused by road vibration.
Dave
I assume this is only for occasional use under controlled circumstances. How about just a simple spring-loaded trailing wheel mounted on·one side of the·rear of the bike that directly measures lean angle (could be as simple as a rotary pot) and sends info to a camera servo up front?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Dave
That's a great idea! It cuts through heaven knows how many lines of trig formulas. Keep it simple. I like it!
-Phil
The wheel should be heavy, though. otherwise it will skip and bounce over the road surface. Depends on your bike, but the swingarm might be blocked by 750 deg exhaust pipe. The other side by a chain.
I'm still a fan of using two ping sensors, pointing down at a 45 deg angle, bungie corded to the back seat. Then you can easily move it between bikes & it doesn't interfere with the bike.
Whatever method you decide, let us know how it goes!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
I ignored all of the math, and this would make a cool simulation in Matlab using lagrange equations and what-not, but I think the idea is at least semi-solid.
T
-Phil